Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use relative import for compiler module in nodes.py (Python 2.5 support) #299

Merged
merged 1 commit into from

2 participants

@jcwilson

This is necessary to avoid a name collision with the deprecated(as of Python 2.6) builtin compiler module in Python 2.5.

This should also be ported to Jinja2 2.6, but I didn't see an appropriate branch for that.

Tested with Python 2.5 on Windows XP

@mitsuhiko mitsuhiko merged commit a2d7871 into mitsuhiko:2.5-maintenance

1 check failed

Details default The Travis CI build failed
@mitsuhiko
Owner

Merged but 2.5 is no longer supported.

@jcwilson

Thanks! I appreciate it since I don't have the luxury of choosing which python version to use. My compliments for having it still work on 2.5 even if it's not officially supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2014
  1. @jcwilson

    using relative import for compiler to avoid name collision with depre…

    jcwilson authored
    …cated builtin compiler module in Python 2.5
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  jinja2/nodes.py
View
2  jinja2/nodes.py
@@ -431,7 +431,7 @@ def from_untrusted(cls, value, lineno=None, environment=None):
constant value in the generated code, otherwise it will raise
an `Impossible` exception.
"""
- from compiler import has_safe_repr
+ from .compiler import has_safe_repr
if not has_safe_repr(value):
raise Impossible()
return cls(value, lineno=lineno, environment=environment)
Something went wrong with that request. Please try again.