From 8e004a8744aecfbab9b6d433d010785e14767440 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 29 Jul 2018 17:48:20 -0400 Subject: [PATCH] fix --- txupnp/tests/test_txupnp.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/txupnp/tests/test_txupnp.py b/txupnp/tests/test_txupnp.py index cdfd340..f0a3062 100644 --- a/txupnp/tests/test_txupnp.py +++ b/txupnp/tests/test_txupnp.py @@ -48,22 +48,22 @@ def test(ext_port=4446, int_port=4446, proto='UDP', timeout=1): @defer.inlineCallbacks -def run_tests(timeout=1): +def run_tests(): + if len(sys.argv) > 1: + log.setLevel(logging.DEBUG) + timeout = int(sys.argv[1]) + else: + timeout = 1 for p in ['UDP']: yield test(proto=p, timeout=timeout) -def main(timeout): - d = run_tests(timeout) +def main(): + d = run_tests() d.addErrback(log.exception) d.addBoth(lambda _: reactor.callLater(0, reactor.stop)) reactor.run() if __name__ == "__main__": - if len(sys.argv) > 1: - log.setLevel(logging.DEBUG) - timeout = int(sys.argv[1]) - else: - timeout = 1 - main(timeout) + main()