Skip to content

Commit c89cecb

Browse files
pythongh-104683: Argument Clinic: Remove unreachable code from _module_and_class()
The hasattr(parent, "classes") check is unneeded, since 'parent' is an instance of either the Module, Class, or Clinic classes, and all of them has a "classes" attribute.
1 parent 80f30cf commit c89cecb

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Tools/clinic/clinic.py

-2
Original file line numberDiff line numberDiff line change
@@ -2427,8 +2427,6 @@ def _module_and_class(
24272427
if child:
24282428
parent = module = child
24292429
continue
2430-
if not hasattr(parent, 'classes'):
2431-
return module, cls
24322430
child = parent.classes.get(field)
24332431
if not child:
24342432
fullname = ".".join(so_far)

0 commit comments

Comments
 (0)