1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00

#682: Warn on instant mode with Python 2

This commit is contained in:
Vladimir Iakovlev 2017-08-28 03:21:15 +02:00
parent 1b694fae7b
commit 6fac0622e5

View File

@ -5,6 +5,7 @@ init_output()
from pprint import pformat # noqa: E402
import sys # noqa: E402
import six # noqa: E402
from . import logs, types # noqa: E402
from .shells import shell # noqa: E402
from .conf import settings # noqa: E402
@ -13,6 +14,7 @@ from .exceptions import EmptyCommand # noqa: E402
from .ui import select_command # noqa: E402
from .argument_parser import Parser # noqa: E402
from .utils import get_installation_info # noqa: E402
from .logs import warn # noqa: E402
def fix_command(known_args):
@ -51,7 +53,11 @@ def main():
fix_command(known_args)
elif known_args.alias:
if known_args.enable_experimental_instant_mode:
alias = shell.instant_mode_alias(known_args.alias)
if six.PY2:
warn("Instant mode not supported with Python 2")
alias = shell.app_alias(known_args.alias)
else:
alias = shell.instant_mode_alias(known_args.alias)
else:
alias = shell.app_alias(known_args.alias)