From: Erlend E. Aasland Date: Thu, 17 Aug 2023 18:16:08 +0000 (+0200) Subject: gh-104683: Argument Clinic: Remove unreachable code from _module_and_class() (#108092) X-Git-Tag: v3.13.0a1~925 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf;p=thirdparty%2FPython%2Fcpython.git gh-104683: Argument Clinic: Remove unreachable code from _module_and_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. --- diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 9f7c47430772..1593dc49e07e 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2427,8 +2427,6 @@ impl_definition block 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)