summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2015-10-28 11:28:48 -0700
committerGravatar qunyanm <unknown>2015-10-28 11:28:48 -0700
commitde000ae9557791fe4cf182eb29eb25d63e4d800e (patch)
tree92812c77b937aa7e9572a82170d3cc909fcf233c
parentab999651fc184fdc6a0cb4b52d1253e6c4b9a060 (diff)
Check version info before delete white space so that it will work with python
version that is less than 3.
-rw-r--r--Test/pydiff.py3
1 files changed, 2 insertions, 1 deletions
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: