From 14993d0af42386f61b04c5951a22f8e24d1d5409 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 12 Jul 2024 14:48:07 -0400 Subject: [PATCH 1/2] Add one more docstring --- uncompyle6/scanner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uncompyle6/scanner.py b/uncompyle6/scanner.py index 64b335db..630fc84f 100644 --- a/uncompyle6/scanner.py +++ b/uncompyle6/scanner.py @@ -605,6 +605,10 @@ class Scanner(ABC): def get_scanner(version: Union[str, tuple], is_pypy=False, show_asm=None) -> Scanner: + """ + Import the right scanner module for ``version`` and return the Scanner class + in that module. + """ # If version is a string, turn that into the corresponding float. if isinstance(version, str): if version not in canonic_python_version: From 703716ca6fd710b3d7ccd2d1f71d288a063ca28f Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 12 Jul 2024 19:07:29 -0400 Subject: [PATCH 2/2] Pick up recewnt try/except change from 2.5 --- uncompyle6/parsers/parse24.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/uncompyle6/parsers/parse24.py b/uncompyle6/parsers/parse24.py index ae92bf41..575b1b43 100644 --- a/uncompyle6/parsers/parse24.py +++ b/uncompyle6/parsers/parse24.py @@ -120,19 +120,6 @@ class Python24Parser(Python25Parser): token_len = len(tokens) if 0 <= token_len < len(tokens): return not int(tokens[first].pattr) == tokens[last].offset - elif lhs == "try_except": - if last == len(tokens): - last -= 1 - if tokens[last] != "COME_FROM" and tokens[last - 1] == "COME_FROM": - last -= 1 - return ( - tokens[last] == "COME_FROM" - and tokens[last - 1] == "END_FINALLY" - and tokens[last - 2] == "POP_TOP" - and tokens[last - 3].kind != "JUMP_FORWARD" - ) - - return False class Python24ParserSingle(Python24Parser, PythonParserSingle):