diff options
| author | Ramin Farajpour Cami <ramin.blackhat@gmail.com> | 2016-11-15 02:10:28 +0330 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-14 17:40:28 -0500 |
| commit | 0a63ef3f61f42c5fd22f2d0b626e386fd426ebed (patch) | |
| tree | 4529b5f5c23db4062a5195f961e4ae468120741e /django/template/smartif.py | |
| parent | c7bfcd2f377ad5803e25ee547dee9cf58ee68ab2 (diff) | |
Fixed #27463 -- Fixed E741 flake8 warnings.
Diffstat (limited to 'django/template/smartif.py')
| -rw-r--r-- | django/template/smartif.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/template/smartif.py b/django/template/smartif.py index ee062d537d..d0cebadc01 100644 --- a/django/template/smartif.py +++ b/django/template/smartif.py @@ -152,15 +152,15 @@ class IfParser(object): def __init__(self, tokens): # Turn 'is','not' and 'not','in' into single tokens. - l = len(tokens) + num_tokens = len(tokens) mapped_tokens = [] i = 0 - while i < l: + while i < num_tokens: token = tokens[i] - if token == "is" and i + 1 < l and tokens[i + 1] == "not": + if token == "is" and i + 1 < num_tokens and tokens[i + 1] == "not": token = "is not" i += 1 # skip 'not' - elif token == "not" and i + 1 < l and tokens[i + 1] == "in": + elif token == "not" and i + 1 < num_tokens and tokens[i + 1] == "in": token = "not in" i += 1 # skip 'in' mapped_tokens.append(self.translate_token(token)) |
