You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Convert docstring from bytes to str
This commit is contained in:
@@ -152,6 +152,9 @@ def is_lambda_mode(compile_mode: str) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def print_docstring(self, indent, docstring):
|
def print_docstring(self, indent, docstring):
|
||||||
|
if isinstance(docstring, bytes):
|
||||||
|
docstring = docstring.decode("utf8", errors="backslashreplace")
|
||||||
|
|
||||||
quote = '"""'
|
quote = '"""'
|
||||||
if docstring.find(quote) >= 0:
|
if docstring.find(quote) >= 0:
|
||||||
if docstring.find("'''") == -1:
|
if docstring.find("'''") == -1:
|
||||||
|
Reference in New Issue
Block a user