mitsuhiko/jinja2 — pull request #185 by kuyan (2013-02-19 01:43:01+00:00)
Title: Fix octal literal and long syntax for Python 3

When I attempt to `import jinja2` on Python 3.3, I get a SyntaxError:

Python 3.3.0 (default, Feb 3 2013, 16:59:54)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
Traceback (most recent call last):
File "", line 1, in
File "./jinja2/__init__.py", line 33, in
from jinja2.environment import Environment, Template
File "./jinja2/environment.py", line 580
info.external_attr = 0755 << 16L
^
SyntaxError: invalid token

This pull request corrects that syntax error by modifying the code in question to reflect changes to octal literal and long integer syntax made in Python 3.0.

The code appears to be compatible across Python versions, with all unit tests in versions 2.6, 2.7, and 3.3 passing. The line modified in this pull request causes a failure with Python 2.5.

Interestingly, while I was unable to import Jinja2 in Python 3.3, the syntax error was not caught when I ran unit tests with that version even though it was caught when I ran the unit tests with Python 2.5.