diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index 4fba0fe..1e64243 100644
a
|
b
|
def gen_filenames(only_new=False):
|
88 | 88 | # application code which might be mutating ``sys.modules``, and this will |
89 | 89 | # fail with RuntimeError: cannot mutate dictionary while iterating |
90 | 90 | global _cached_modules, _cached_filenames |
91 | | module_values = set(sys.modules.values()) |
| 91 | module_values = set([module for module in sys.modules.values() |
| 92 | if hasattr(module, '__file__')]) |
92 | 93 | _cached_filenames = clean_files(_cached_filenames) |
93 | 94 | if _cached_modules == module_values: |
94 | 95 | # No changes in module list, short-circuit the function |
… |
… |
def gen_filenames(only_new=False):
|
98 | 99 | return _cached_filenames + clean_files(_error_files) |
99 | 100 | |
100 | 101 | new_modules = module_values - _cached_modules |
101 | | new_filenames = clean_files( |
102 | | [filename.__file__ for filename in new_modules |
103 | | if hasattr(filename, '__file__')]) |
| 102 | new_filenames = clean_files([module.__file__ for module in new_modules]) |
104 | 103 | |
105 | 104 | if not _cached_filenames and settings.USE_I18N: |
106 | 105 | # Add the names of the .mo files that can be generated |