You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +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
|
||||
# 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
|
||||
subclass_code = find_code_node(load_closure, -2).attr
|
||||
else:
|
||||
raise "Internal Error n_classdef: cannot find class body"
|
||||
if hasattr(build_class[3], "__len__"):
|
||||
if not subclass_info:
|
||||
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"
|
||||
raise RuntimeError("Internal Error n_classdef: cannot find class body")
|
||||
|
||||
subclass_info = build_class
|
||||
|
||||
elif not subclass_info:
|
||||
if mkfunc[0] in ("no_kwargs", "kwargs"):
|
||||
subclass_code = mkfunc[1].attr
|
||||
|
Reference in New Issue
Block a user