diff options
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/autoreload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index 931f4b82e4..427d979a7f 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -111,7 +111,7 @@ def iter_modules_and_files(modules, extra_files): # During debugging (with PyDev) the 'typing.io' and 'typing.re' objects # are added to sys.modules, however they are types not modules and so # cause issues here. - if not isinstance(module, ModuleType) or module.__spec__ is None: + if not isinstance(module, ModuleType) or getattr(module, '__spec__', None) is None: continue spec = module.__spec__ # Modules could be loaded from places without a concrete location. If |
