[diffoscope] 01/01: Fix maybe_decode() so that it actually works

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Jul 15 23:02:38 CEST 2016


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository diffoscope.

commit 86f2ee59ccf35937c10f1030618d076873aaaa9a
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Fri Jul 15 22:59:40 2016 +0200

    Fix maybe_decode() so that it actually works
---
 diffoscope/comparators/binary.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diffoscope/comparators/binary.py b/diffoscope/comparators/binary.py
index dfab2dd..941ecf7 100644
--- a/diffoscope/comparators/binary.py
+++ b/diffoscope/comparators/binary.py
@@ -39,10 +39,10 @@ from diffoscope import tool_required, RequiredToolNotFound, OutputParsingError,
 
 # helper function to convert to bytes if necessary
 def maybe_decode(s):
-    if str == bytes:
-        return s
-    else:
+    if type(s) is bytes:
         return s.decode('utf-8')
+    else:
+        return s
 
 def hexdump_fallback(path):
     hexdump = StringIO()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list