ported some more stuff to py 3.3

removed init_jinja_globals hack from app.py after consulting mitsuhiko
(didn't work on py 3.3 "as is")

removed with_statement future imports, not needed any more

needs more work on 2.7 as well as on 3.3
This commit is contained in:
Thomas Waldmann 2013-05-22 01:33:04 +02:00
parent a503520ac5
commit e1d356fb71
24 changed files with 36 additions and 87 deletions

View file

@ -22,6 +22,7 @@ if not PY2:
range_type = range
text_type = str
string_types = (str,)
integer_types = (int, )
iterkeys = lambda d: iter(d.keys())
itervalues = lambda d: iter(d.values())
@ -46,11 +47,14 @@ if not PY2:
encode_filename = _identity
get_next = lambda x: x.__next__
from urllib.parse import urlparse
else:
unichr = unichr
text_type = unicode
range_type = xrange
string_types = (str, unicode)
integer_types = (int, long)
iterkeys = lambda d: d.iterkeys()
itervalues = lambda d: d.itervalues()
@ -82,6 +86,8 @@ else:
return filename.encode('utf-8')
return filename
from urlparse import urlparse
def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a