You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Fix in 3.3 subclass detection in class closures
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2018-2021, 2023 by Rocky Bernstein
|
# Copyright (c) 2018-2021, 2023-2024 by Rocky Bernstein
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -139,14 +139,10 @@ def customize_for_version3(self, version):
|
|||||||
# Python 3.2 works like this
|
# Python 3.2 works like this
|
||||||
subclass_code = find_code_node(load_closure, -2).attr
|
subclass_code = find_code_node(load_closure, -2).attr
|
||||||
else:
|
else:
|
||||||
raise "Internal Error n_classdef: cannot find class body"
|
raise RuntimeError("Internal Error n_classdef: cannot find class body")
|
||||||
if hasattr(build_class[3], "__len__"):
|
|
||||||
if not subclass_info:
|
subclass_info = build_class
|
||||||
subclass_info = build_class[3]
|
|
||||||
elif hasattr(build_class[2], "__len__"):
|
|
||||||
subclass_info = build_class[2]
|
|
||||||
else:
|
|
||||||
raise "Internal Error n_classdef: cannot superclass name"
|
|
||||||
elif not subclass_info:
|
elif not subclass_info:
|
||||||
if mkfunc[0] in ("no_kwargs", "kwargs"):
|
if mkfunc[0] in ("no_kwargs", "kwargs"):
|
||||||
subclass_code = mkfunc[1].attr
|
subclass_code = mkfunc[1].attr
|
||||||
|
Reference in New Issue
Block a user