Skip to content

Commit

Permalink
gh-104683: Argument Clinic: Remove unreachable code from _module_and_…
Browse files Browse the repository at this point in the history
…class() (#108092)

'not hasattr(parent, "classes")' is always false, 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 292a22b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Tools/clinic/clinic.py
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 292a22b

Please sign in to comment.