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`
pull/612/head
Marc Hartmayer 5 years ago
parent 0a6c0cd8fb
commit 2ed8395d6c

@ -462,7 +462,7 @@ class DefectivePython3xMainMethod(FinderMethod):
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')

Loading…
Cancel
Save