From: Daniel Morrison Date: Tue, 18 Nov 2014 04:13:53 +0000 (-0500) Subject: Speed up unicode support. X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=bcb8de53fd29f9bf7476443034569fbdea15af03;p=chevron.git Speed up unicode support. - Remove uneeded import - Remove uneeded if statement --- 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"""