diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index 119bebb1485..94c74e582a1 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -81,7 +81,7 @@ def gen_filenames(): Yields a generator over filenames referenced in sys.modules and translation files. """ - filenames = [filename.__file__ for filename in list(sys.modules.values()) + filenames = [filename.__file__ for filename in sys.modules.values() if hasattr(filename, '__file__')] if settings.USE_I18N: