From 0f527a01f427fe06dc0219e2bc8ad6897c8f54fb Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 19 Feb 2018 12:42:41 +0000 Subject: [PATCH] Handle the case where module.__file__ is None. Fixes #1058 --- gunicorn/reloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index b1ce743f..4ab868e9 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -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: