From de000ae9557791fe4cf182eb29eb25d63e4d800e Mon Sep 17 00:00:00 2001 From: qunyanm Date: Wed, 28 Oct 2015 11:28:48 -0700 Subject: Check version info before delete white space so that it will work with python version that is less than 3. --- Test/pydiff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Test/pydiff.py') diff --git a/Test/pydiff.py b/Test/pydiff.py index 407fe251..94267960 100644 --- a/Test/pydiff.py +++ b/Test/pydiff.py @@ -75,7 +75,8 @@ def preProcess(openFile, stripTrailingCR=False, ignoreAllSpace=False): # newline characters because this will create a mess when outputting the # diff. Is this the right behaviour? deleteChars=' \t' - translationTable = str.maketrans('','', deleteChars) + if sys.version_info.major >= 3: + translationTable = str.maketrans('','', deleteChars) copy = [ ] for line in original: -- cgit v1.2.3