InotifyReloader: Handle module.__file__ is None

0f527a01f4 added a fix for the case when some modules have the `__file__` attr set to `None`, for the polling reloader. Unfortunately, it missed making the same fix for the inotify reloader.

This change copies that fix into InotifyReloader
This commit is contained in:
Pritam Baral 2018-09-17 16:51:40 +05:30 committed by Randall Leeds
parent 0ce857fced
commit 30554fdb4f

View File

@ -96,7 +96,7 @@ if has_inotify:
fnames = [
os.path.dirname(COMPILED_EXT_RE.sub('py', module.__file__))
for module in tuple(sys.modules.values())
if hasattr(module, '__file__')
if getattr(module, '__file__', None)
]
return set(fnames)