diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2019-02-09 15:07:04 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-09 19:08:22 -0500 |
| commit | 1835563ab8a1da949a35316d16989236ac585c6c (patch) | |
| tree | b601422001c5a53be3b353f01107dc319cc2175d /django/utils/autoreload.py | |
| parent | a98bcfb0dd641a4a3ce3ec1acba55f804ade7bad (diff) | |
Removed unneeded list() calls in sorted() argument.
Diffstat (limited to 'django/utils/autoreload.py')
| -rw-r--r-- | django/utils/autoreload.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index 736e88cfe9..2ca4d6f74a 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -98,8 +98,8 @@ def iter_all_python_module_files(): # modules based on the module name and pass it to iter_modules_and_files(). # This ensures cached results are returned in the usual case that modules # aren't loaded on the fly. - modules_view = sorted(list(sys.modules.items()), key=lambda i: i[0]) - modules = tuple(m[1] for m in modules_view if not isinstance(m[1], weakref.ProxyTypes)) + keys = sorted(sys.modules) + modules = tuple(m for m in map(sys.modules.__getitem__, keys) if not isinstance(m, weakref.ProxyTypes)) return iter_modules_and_files(modules, frozenset(_error_files)) |
