From 7fd4bdbc26d9ff5c4cccecae186b23f9f9f45814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Ram=C3=ADrez?= Date: Fri, 8 May 2015 12:25:26 -0600 Subject: [PATCH] Fix reading 'major' property on Python 2.6. --- secretary.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/secretary.py b/secretary.py index 7296620..cae1052 100644 --- a/secretary.py +++ b/secretary.py @@ -29,9 +29,14 @@ from xml.dom.minidom import parseString from xml.parsers.expat import ExpatError from jinja2 import Environment, Undefined -if sys.version_info.major == 3: - xrange = range - basestring = (str, bytes) +try: + if sys.version_info.major == 3: + xrange = range + basestring = (str, bytes) +except AttributeError: + # On Python 2.6 sys.version_info is a tuple + if not isinstance(sys.version_info, tuple): + raise FLOW_REFERENCES = {