From 8255681b9df554cd73dee792cda037396555f45a Mon Sep 17 00:00:00 2001 From: noah morrison Date: Sun, 25 Jan 2015 15:41:30 -0500 Subject: [PATCH] Change version checking method. (flake8) Importing sys is better then checking if unicode is defined. --- chevron/renderer.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 # -- 2.47.3