Merge pull request #1708 from EdwardBetts/patch-1

Handle the case where module.__file__ is None.
This commit is contained in:
Benoit Chesneau 2018-02-19 17:25:03 +01:00 committed by GitHub
commit 8e479865d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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