diff options
author | nnako <nnako@web.de> | 2018-04-21 15:40:08 +0200 |
---|---|---|
committer | nnako <nnako@web.de> | 2018-04-21 15:40:08 +0200 |
commit | 2a5ef0ecd0841efc922e3e7f4ff884aa5cfa2051 (patch) | |
tree | f506d4ad1ea6112195fcf830aad28c0e64ae1296 /diff2HtmlCompare.py | |
parent | 0a6f8a5666e6df99ab90070514d5704fe2d8ba41 (diff) | |
download | wsdiff-2a5ef0ecd0841efc922e3e7f4ff884aa5cfa2051.tar.gz wsdiff-2a5ef0ecd0841efc922e3e7f4ff884aa5cfa2051.tar.bz2 wsdiff-2a5ef0ecd0841efc922e3e7f4ff884aa5cfa2051.zip |
FIX: enable error-free string output for Python v2 and v3
Diffstat (limited to 'diff2HtmlCompare.py')
-rw-r--r-- | diff2HtmlCompare.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/diff2HtmlCompare.py b/diff2HtmlCompare.py index 4dbdc67..04b1f3c 100644 --- a/diff2HtmlCompare.py +++ b/diff2HtmlCompare.py @@ -238,7 +238,12 @@ class DiffHtmlFormatter(HtmlFormatter): for t, line in inner: if t: lncount += 1 - dummyoutfile.write(unicode(line)) + + # compatibility Python v2/v3 + if sys.version_info > (3,0): + dummyoutfile.write(line) + else: + dummyoutfile.write(unicode(line)) fl = self.linenostart mw = len(str(lncount + fl - 1)) |