Skip to content

Commit c499d0a

Browse files
committed
Fix in 3.3 subclass detection in class closures
1 parent d2d4367 commit c499d0a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

uncompyle6/semantics/customize3.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018-2021, 2023 by Rocky Bernstein
1+
# Copyright (c) 2018-2021, 2023-2024 by Rocky Bernstein
22
#
33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -139,14 +139,10 @@ def n_classdef3(node):
139139
# Python 3.2 works like this
140140
subclass_code = find_code_node(load_closure, -2).attr
141141
else:
142-
raise "Internal Error n_classdef: cannot find class body"
143-
if hasattr(build_class[3], "__len__"):
144-
if not subclass_info:
145-
subclass_info = build_class[3]
146-
elif hasattr(build_class[2], "__len__"):
147-
subclass_info = build_class[2]
148-
else:
149-
raise "Internal Error n_classdef: cannot superclass name"
142+
raise RuntimeError("Internal Error n_classdef: cannot find class body")
143+
144+
subclass_info = build_class
145+
150146
elif not subclass_info:
151147
if mkfunc[0] in ("no_kwargs", "kwargs"):
152148
subclass_code = mkfunc[1].attr

0 commit comments

Comments
 (0)