Skip to content
Myr

Merge pull request #213 from Lukasa/luk-sprint-branch

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 · parents 9dd7fad, 02a4654 · Browse files · 5 files+9 added−10 removed
This commit

State

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

Trailers

  • Sprint: Misc fixes.

Diff stats

5 files+9 added−10 removed

  • other:+9 added−10 removed

5 files+9 added−10 removed

modified:jinja2/testsuite/__init__.py+1 added-1 removed
87 unmodified lines
88 suite.addTest(utils.suite())8990 # doctests will not run on python 3 currently. Too many issues91 # with that, do not test that on that platform.92 if sys.version_info < (3, 0):92 if sys.version_info[0] < 3:93 suite.addTest(doctests.suite())9495 return suite
modified:jinja2/testsuite/debug.py+5 added-6 removed
18 unmodified lines
192021class DebugTestCase(JinjaTestCase):2223 if sys.version_info[:2] != (2, 4):24 def test_runtime_error(self):25 def test():26 tmpl.render(fail=lambda: 1 / 0)27 tmpl = env.get_template('broken.html')28 self.assert_traceback_matches(test, r'''23 def test_runtime_error(self):24 def test():25 tmpl.render(fail=lambda: 1 / 0)26 tmpl = env.get_template('broken.html')27 self.assert_traceback_matches(test, r'''28 File ".*?broken.html", line 2, in (top-level template code|<module>)29 \{\{ fail\(\) \}\}30 File ".*?debug.pyc?", line \d+, in <lambda>31 tmpl\.render\(fail=lambda: 1 / 0\)
28 unmodified lines
modified:jinja2/testsuite/lexnparse.py+1 added-1 removed
20 unmodified lines
21env = Environment()222324# how does a string look like in jinja syntax?25if sys.version_info < (3, 0):25if sys.version_info[0] < 3:26 def jinja_string_repr(string):27 return repr(string)[1:]28else:29 jinja_string_repr = repr
385 unmodified lines
modified:jinja2/bccache.py+1 added-1 removed
26 unmodified lines
27from jinja2.utils import open_if_exists282930# marshal works better on 3.x, one hack less required31if sys.version_info > (3, 0):31if sys.version_info[0] > 3:32 from io import BytesIO33 marshal_dump = marshal.dump34 marshal_load = marshal.load35else:
266 unmodified lines
modified:jinja2/utils.py+1 added-1 removed
51 unmodified lines
52# when passed to encode we let this function encode it properly.53# This is used in a couple of places. As far as Jinja is concerned54# filenames are unicode *or* bytestrings in 2.x and unicode only in55# 3.x because compile cannot handle bytes56if sys.version_info < (3, 0):56if sys.version_info[0] < 3:57 def _encode_filename(filename):58 if isinstance(filename, unicode):59 return filename.encode('utf-8')60 return filename
518 unmodified lines