Skip to content

Commit

Permalink
pythongh-104683: Argument Clinic: Remove unreachable code from _modul…
Browse files Browse the repository at this point in the history
…e_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.
  • Loading branch information
erlend-aasland committed Aug 17, 2023
1 parent 80f30cf commit c89cecb
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2427,8 +2427,6 @@ def _module_and_class(
if child:
parent = module = child
continue
if not hasattr(parent, 'classes'):
return module, cls
child = parent.classes.get(field)
if not child:
fullname = ".".join(so_far)
Expand Down

0 comments on commit c89cecb

Please sign in to comment.