Merge branch 'python3_fix' of git://github.com/ak04nv/secretary into ak04nv-python3_fix
This commit is contained in:
commit
d1aee1c0fc
1 changed files with 3 additions and 15 deletions
16
secretary.py
16
secretary.py
|
|
@ -29,21 +29,9 @@ from xml.dom.minidom import parseString
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
from jinja2 import Environment, Undefined
|
from jinja2 import Environment, Undefined
|
||||||
|
|
||||||
# Test python versions and normalize calls to basestring, unicode, etc.
|
if sys.version_info.major == 3:
|
||||||
try:
|
xrange = range
|
||||||
unicode = unicode
|
|
||||||
except NameError:
|
|
||||||
# 'unicode' is undefined, must be Python 3
|
|
||||||
str = str
|
|
||||||
unicode = str
|
|
||||||
bytes = bytes
|
|
||||||
basestring = (str, bytes)
|
basestring = (str, bytes)
|
||||||
else:
|
|
||||||
# 'unicode' exists, must be Python 2
|
|
||||||
str = str
|
|
||||||
unicode = unicode
|
|
||||||
bytes = str
|
|
||||||
basestring = basestring
|
|
||||||
|
|
||||||
|
|
||||||
FLOW_REFERENCES = {
|
FLOW_REFERENCES = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue