diff options
author | Alex Goodman <wagoodman@users.noreply.github.com> | 2018-04-21 20:33:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 20:33:56 -0400 |
commit | b151d377b2988f985a24c8e260df5a48779339ab (patch) | |
tree | f506d4ad1ea6112195fcf830aad28c0e64ae1296 | |
parent | 0a6f8a5666e6df99ab90070514d5704fe2d8ba41 (diff) | |
parent | 2a5ef0ecd0841efc922e3e7f4ff884aa5cfa2051 (diff) | |
download | wsdiff-b151d377b2988f985a24c8e260df5a48779339ab.tar.gz wsdiff-b151d377b2988f985a24c8e260df5a48779339ab.tar.bz2 wsdiff-b151d377b2988f985a24c8e260df5a48779339ab.zip |
Merge pull request #6 from nnako/master
FIX: enable error-free string output for Python v2 and v3
-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)) |