From 48a2bd04fa5a4095f0a5d8556c8113afb672664d Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Fri, 11 Nov 2016 18:20:54 +0100 Subject: [bug] fix cli autostart this reverts the refactoring made at 596f1f8 it seems it is now allowed to call a function that yields from inside as part of an inline deferred. --- src/leap/bitmask/cli/bitmask_cli.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py index e72d1f6..34c2356 100755 --- a/src/leap/bitmask/cli/bitmask_cli.py +++ b/src/leap/bitmask/cli/bitmask_cli.py @@ -121,19 +121,15 @@ GENERAL COMMANDS: value + Fore.RESET) -def _check_started(cli): +@defer.inlineCallbacks +def execute(): + cli = BitmaskCLI() cli.data = ['version'] args = ['--verbose'] if '--verbose' in sys.argv else None yield cli._send( timeout=0.1, printer=_null_printer, errb=lambda: cli.start(args)) cli.data = [] - - -@defer.inlineCallbacks -def execute(): - cli = BitmaskCLI() - _check_started(cli) yield cli.execute(sys.argv[1:]) try: yield reactor.stop() -- cgit v1.2.3