From 292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 17 Aug 2023 20:16:08 +0200 Subject: [PATCH] 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. --- Tools/clinic/clinic.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 9f7c47430772f7..1593dc49e07e1f 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -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)