diff --git a/mitogen/compat/pkgutil.py b/mitogen/compat/pkgutil.py index 28e2aeade..df3983a2b 100644 --- a/mitogen/compat/pkgutil.py +++ b/mitogen/compat/pkgutil.py @@ -542,7 +542,7 @@ def extend_path(path, name): if os.path.isfile(pkgfile): try: f = open(pkgfile) - except IOError, msg: + except IOError as msg: sys.stderr.write("Can't open %s: %s\n" % (pkgfile, msg)) else: diff --git a/mitogen/master.py b/mitogen/master.py index 48f82ab17..814f7019b 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -462,7 +462,7 @@ def find(self, fullname): return None path = getattr(mod, '__file__', None) - if not (os.path.exists(path) and _looks_like_script(path)): + if not (path is not None and os.path.exists(path) and _looks_like_script(path)): return None fp = open(path, 'rb') diff --git a/mitogen/parent.py b/mitogen/parent.py index 99d8d6216..79b484c2a 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -2331,7 +2331,7 @@ def disconnect(self, context): directly connected. """ stream = self.stream_by_id(context) - if stream.remote_id != context.context_id: + if stream.protocol.remote_id != context.context_id: return l = mitogen.core.Latch()