Handle the case where module.__file__ is None.

Fixes #1058
This commit is contained in:
Edward Betts 2018-02-19 12:42:41 +00:00 committed by GitHub
parent d32f4ca325
commit 0f527a01f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ class Reloader(threading.Thread):
fnames = [
re.sub('py[co]$', 'py', module.__file__)
for module in list(sys.modules.values())
if hasattr(module, '__file__')
if getattr(module, '__file__', None)
]
with self._extra_files_lock: