Skip to content

Commit 2ed8395

Browse files
author
Marc Hartmayer
committed
master: fix TypeError
Add a guard for the case `path == None`. This commit fixes `TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType`
1 parent 0a6c0cd commit 2ed8395

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mitogen/master.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def find(self, fullname):
462462
return None
463463

464464
path = getattr(mod, '__file__', None)
465-
if not (os.path.exists(path) and _looks_like_script(path)):
465+
if not (path is not None and os.path.exists(path) and _looks_like_script(path)):
466466
return None
467467

468468
fp = open(path, 'rb')

0 commit comments

Comments
 (0)