From 776672af607e359468dc87e7efcca28260f70a7d Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 10 Nov 2018 10:58:27 -0700 Subject: For PR #3238: use a try block for str/bytes problem The previous fix changed a failing line that printed something that could be bytes in Py3 to do a decode. But it turned out that value can be either str or bytes and the change failed the sconsign tests. Use a try block instead of unconditionally calling decode. Signed-off-by: Mats Wichmann --- src/script/sconsign.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 42424a2..567dc07 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -453,7 +453,10 @@ class Do_SConsignDB(object): @staticmethod def printentries(dir, val): - print('=== ' + dir.decode() + ':') + try: + print('=== ' + dir + ':') + except TypeError: + print('=== ' + dir.decode() + ':') printentries(pickle.loads(val), dir) -- cgit v0.12