diff options
| author | Tomasz Wysocki <tomasz@pozytywnie.pl> | 2014-04-02 17:29:56 +0200 |
|---|---|---|
| committer | Tomasz Wysocki <tomasz@pozytywnie.pl> | 2014-04-02 17:32:51 +0200 |
| commit | cb9704fc4ff0d0091814c59bc3bed90e9728cb16 (patch) | |
| tree | 5995a4b57ee8f1ab3f4dca52c0a9cad1e7f8d17c | |
| parent | 9769337ca855f4831c855d6663ff3f688ee1652d (diff) | |
Refactor. Stop using memory for list copies.
| -rw-r--r-- | django/utils/translation/trans_real.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index e47c19ca6a..9a2c618962 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -168,7 +168,7 @@ def translation(language): # doesn't affect en-gb), even though they will both use the core "en" # translation. So we have to subvert Python's internal gettext caching. base_lang = lambda x: x.split('-', 1)[0] - if base_lang(lang) in [base_lang(trans) for trans in list(_translations)]: + if any(base_lang(lang) == base_lang(trans) for trans in _translations): res._info = res._info.copy() res._catalog = res._catalog.copy() |
