diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-14 14:22:08 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-14 14:31:06 +0200 |
| commit | 0c198b85a3292cb7f2f2cd1b2d6dc6f04a1ed831 (patch) | |
| tree | fa77f7511b05ca3bee54cc55159fe39db769050c /django/utils/autoreload.py | |
| parent | 5b27e6f64b481be0fda0996456482eb56e12f2b5 (diff) | |
[py3] Replace filter/lambda by list comprehensions
This is more idiomatic and avoids returning a list on Python 2 and
an iterator on Python 3.
Diffstat (limited to 'django/utils/autoreload.py')
| -rw-r--r-- | django/utils/autoreload.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index b6c055383c..9032cd024d 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -54,7 +54,8 @@ _win = (sys.platform == "win32") def code_changed(): global _mtimes, _win - for filename in filter(lambda v: v, map(lambda m: getattr(m, "__file__", None), sys.modules.values())): + filenames = [getattr(m, "__file__", None) for m in sys.modules.values()] + for filename in filter(None, filenames): if filename.endswith(".pyc") or filename.endswith(".pyo"): filename = filename[:-1] if filename.endswith("$py.class"): |
