From 4cd10b79e251008a3104d2054ed294a75641aa76 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:48:39 +0000 Subject: [PATCH] Convert docstring from bytes to str --- uncompyle6/semantics/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uncompyle6/semantics/helper.py b/uncompyle6/semantics/helper.py index 27c21a0d..78998bec 100644 --- a/uncompyle6/semantics/helper.py +++ b/uncompyle6/semantics/helper.py @@ -152,6 +152,9 @@ def is_lambda_mode(compile_mode: str) -> bool: def print_docstring(self, indent, docstring): + if isinstance(docstring, bytes): + docstring = docstring.decode("utf8", errors="backslashreplace") + quote = '"""' if docstring.find(quote) >= 0: if docstring.find("'''") == -1: