summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorshiningfm <shiningfm@users.noreply.github.com>2019-02-27 16:35:30 +0100
committerTim Graham <timograham@gmail.com>2019-02-27 10:35:30 -0500
commit99cfb28e995388db109e2f2ed15307f09945dda8 (patch)
treebb5527c4d510db3366df8e8048e432e7619a3dcd /django/utils
parent5deb7a86e8b54d052a3b1dbed1ae7142d362b1c5 (diff)
Fixed #30215 -- Fixed autoreloader crash for modules without __spec__.
Regression in c8720e7696ca41f3262d5369365cc1bd72a216ca.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/autoreload.py2
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