From dada79d85cf7d896ed2d4813268fec913c08ffbf Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 16 Jun 2018 16:17:26 -0700 Subject: [PATCH] fix remaining pep8 complaints --- src/wormhole/cli/welcome.py | 4 ++-- src/wormhole/test/test_cli.py | 2 +- src/wormhole/transit.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wormhole/cli/welcome.py b/src/wormhole/cli/welcome.py index 2bbfc7e..32c1f84 100644 --- a/src/wormhole/cli/welcome.py +++ b/src/wormhole/cli/welcome.py @@ -11,8 +11,8 @@ def handle_welcome(welcome, relay_url, my_version, stderr): # Only warn if we're running a release version (e.g. 0.0.6, not # 0.0.6+DISTANCE.gHASH). Only warn once. - if ("current_cli_version" in welcome and "+" not in my_version - and welcome["current_cli_version"] != my_version): + if ("current_cli_version" in welcome and "+" not in my_version and + welcome["current_cli_version"] != my_version): print( ("Warning: errors may occur unless both sides are running the" " same version"), diff --git a/src/wormhole/test/test_cli.py b/src/wormhole/test/test_cli.py index a5d5478..d983d51 100644 --- a/src/wormhole/test/test_cli.py +++ b/src/wormhole/test/test_cli.py @@ -684,7 +684,7 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase): self.failUnlessEqual(receive_stdout, "") self.failUnlessIn(u"Receiving file ({size:s}) into: {name}".format( size=naturalsize(len(message)), name=receive_filename), - receive_stderr) + receive_stderr) self.failUnlessIn(u"Received file written to ", receive_stderr) fn = os.path.join(receive_dir, receive_filename) self.failUnless(os.path.exists(fn)) diff --git a/src/wormhole/transit.py b/src/wormhole/transit.py index 6363c6d..d2b2c98 100644 --- a/src/wormhole/transit.py +++ b/src/wormhole/transit.py @@ -751,12 +751,12 @@ class Common: if hint_type not in [u"direct-tcp-v1", u"tor-tcp-v1"]: log.msg("unknown hint type: %r" % (hint, )) return None - if not (u"hostname" in hint - and isinstance(hint[u"hostname"], type(u""))): + if not (u"hostname" in hint and + isinstance(hint[u"hostname"], type(u""))): log.msg("invalid hostname in hint: %r" % (hint, )) return None - if not (u"port" in hint - and isinstance(hint[u"port"], six.integer_types)): + if not (u"port" in hint and + isinstance(hint[u"port"], six.integer_types)): log.msg("invalid port in hint: %r" % (hint, )) return None priority = hint.get(u"priority", 0.0)