Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19485 -- Python 3 compatibility for c2a6b2a.

Refs #9589.
  • Loading branch information...
commit bbabfdcccee9ccd98fc140233dee748253bcb4a2 1 parent 85712a5
@aaugustin aaugustin authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/utils/autoreload.py
View
9 django/utils/autoreload.py
@@ -56,8 +56,13 @@
def code_changed():
global _mtimes, _win
- filenames = [getattr(m, "__file__", None) for m in sys.modules.values()]
- for filename in filter(None, filenames) + _error_files:
+ filenames = []
+ for m in sys.modules.values():
+ try:
+ filenames.append(m.__file__)
+ except AttributeError:
+ pass
+ for filename in filenames + _error_files:
if filename.endswith(".pyc") or filename.endswith(".pyo"):
filename = filename[:-1]
if filename.endswith("$py.class"):
Please sign in to comment.
Something went wrong with that request. Please try again.