From: noah morrison Date: Sun, 25 Jan 2015 20:41:30 +0000 (-0500) Subject: Change version checking method. (flake8) X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=8255681b9df554cd73dee792cda037396555f45a;p=chevron.git Change version checking method. (flake8) Importing sys is better then checking if unicode is defined. --- diff --git a/chevron/renderer.py b/chevron/renderer.py index c5dea30..a665122 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -12,13 +12,15 @@ except (ValueError, SystemError): from tokenizer import tokenize -try: # python 2 - unicode - python3 = False -except: +import sys +if sys.version_info[0] == 3: + python3 = True + def unicode(x, y): return x - python3 = True + +else: # python 2 + python3 = False #