From f6a78cb4b2409ffbc3226d3c58e850629fdd5045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Ram=C3=ADrez?= Date: Sun, 20 Jul 2014 13:14:11 -0600 Subject: [PATCH] Fix import error in pyhton 2.6. --- secretary.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/secretary.py b/secretary.py index b586869..a2fcd68 100644 --- a/secretary.py +++ b/secretary.py @@ -22,10 +22,15 @@ import re import sys import logging import zipfile -from collections import OrderedDict from xml.dom.minidom import parseString from jinja2 import Environment, Undefined +try: + from collections import OrderedDict +except ImportError: + # Its python 2.6 + pass + # Test python versions and normalize calls to basestring, unicode, etc. try: unicode = unicode @@ -305,7 +310,7 @@ class Renderer(object): def _encode_escape_chars(self, xml_text): if sys.version_info >= (2, 7): encode_rules = OrderedDict() - + encode_rules = { '(?i)(.*)(\n)(.*)': r'\1\3', '(?i)(.*)(\u0009)(.*)': r'\1\3',