summaryrefslogtreecommitdiff
path: root/django/template/base.py
diff options
context:
space:
mode:
authorMads Jensen <mje@inducks.org>2018-03-24 20:43:01 +0100
committerTim Graham <timograham@gmail.com>2018-03-24 19:10:56 -0400
commit623117d1f1d7866b7321f0e73a6c497bb3b3cb01 (patch)
treedf4c95a17f19d7420850c1035703773a40f8e711 /django/template/base.py
parent29150d5da880ac1db15e47052330790cf1b802d2 (diff)
Removed unnecessary variable in Lexer.create_token().
Diffstat (limited to 'django/template/base.py')
-rw-r--r--django/template/base.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 9c81a361f2..4a292c55a7 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -367,19 +367,18 @@ class Lexer:
self.verbatim = False
if in_tag and not self.verbatim:
if token_string.startswith(VARIABLE_TAG_START):
- token = Token(TOKEN_VAR, token_string[2:-2].strip(), position, lineno)
+ return Token(TOKEN_VAR, token_string[2:-2].strip(), position, lineno)
elif token_string.startswith(BLOCK_TAG_START):
if block_content[:9] in ('verbatim', 'verbatim '):
self.verbatim = 'end%s' % block_content
- token = Token(TOKEN_BLOCK, block_content, position, lineno)
+ return Token(TOKEN_BLOCK, block_content, position, lineno)
elif token_string.startswith(COMMENT_TAG_START):
content = ''
if token_string.find(TRANSLATOR_COMMENT_MARK):
content = token_string[2:-2].strip()
- token = Token(TOKEN_COMMENT, content, position, lineno)
+ return Token(TOKEN_COMMENT, content, position, lineno)
else:
- token = Token(TOKEN_TEXT, token_string, position, lineno)
- return token
+ return Token(TOKEN_TEXT, token_string, position, lineno)
class DebugLexer(Lexer):