Skip to content
Myr

Fix for #304

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c8c70ff · Browse files · 1 file+6 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−5 removed

  • other:+6 added−5 removed

1 file+6 added−5 removed

modified:jinja2/lexer.py+6 added-5 removed
19 unmodified lines
20from collections import deque21from jinja2.exceptions import TemplateSyntaxError22from jinja2.utils import LRUCache23from jinja2._compat import iteritems, implements_iterator, text_type, \24 intern24 intern, PY2252627# cache for the lexers. Exists in order to be able to have multiple28# environments with the same lexer
548 unmodified lines
577 # if we can express it as bytestring (ascii only)578 # we do that for support of semi broken APIs579 # as datetime.datetime.strftime. On python 3 this580 # call becomes a noop thanks to 2to3581 if PY2:581 try:582 value = str(value)583 except UnicodeError:584 pass582 try:583 value = value.encode('ascii')584 except UnicodeError:585 pass586 elif token == 'integer':587 value = int(value)588 elif token == 'float':589 value = float(value)
145 unmodified lines