From bcb8de53fd29f9bf7476443034569fbdea15af03 Mon Sep 17 00:00:00 2001 From: Daniel Morrison Date: Mon, 17 Nov 2014 23:13:53 -0500 Subject: [PATCH] Speed up unicode support. - Remove uneeded import - Remove uneeded if statement --- chevron.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chevron.py b/chevron.py index 6765baa..dd2f49a 100755 --- a/chevron.py +++ b/chevron.py @@ -2,14 +2,16 @@ import json -from sys import argv, version - -python3 = False -if version > '3': - python3 = True +from sys import argv +try: + unicode + python3 = False +except: def unicode(x, y): return x + python3 = True + class UnclosedSection(Exception): """Raised when you have unbalanced section tags""" -- 2.47.3