From 1825995c4dbcbf079bf485e9bcb5064753c1c8c2 Mon Sep 17 00:00:00 2001 From: Anton Kochnev Date: Thu, 7 May 2015 16:02:37 +0800 Subject: [PATCH] fixed xrange issue in py3 --- secretary.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/secretary.py b/secretary.py index 75731f9..7296620 100644 --- a/secretary.py +++ b/secretary.py @@ -29,21 +29,9 @@ from xml.dom.minidom import parseString from xml.parsers.expat import ExpatError from jinja2 import Environment, Undefined -# Test python versions and normalize calls to basestring, unicode, etc. -try: - unicode = unicode -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 +if sys.version_info.major == 3: + xrange = range + basestring = (str, bytes) FLOW_REFERENCES = {