fixed xrange issue in py3
This commit is contained in:
parent
81f6b9af7e
commit
1825995c4d
1 changed files with 3 additions and 15 deletions
18
secretary.py
18
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
|
basestring = (str, bytes)
|
||||||
except NameError:
|
|
||||||
# 'unicode' is undefined, must be Python 3
|
|
||||||
str = str
|
|
||||||
unicode = str
|
|
||||||
bytes = 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