summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2023-08-17 18:16:08 (GMT)
committerGitHub <noreply@github.com>2023-08-17 18:16:08 (GMT)
commit292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf (patch)
tree1cc7b0b802414d13ec24520f5ee6ae06a982c6a7
parent80f30cf51bd89411ef1220d714b33667d6a39901 (diff)
downloadcpython-292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf.zip
cpython-292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf.tar.gz
cpython-292a22bdc22f2aa70c96e9e53ca6d6b0c5f8d5bf.tar.bz2
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.
-rwxr-xr-xTools/clinic/clinic.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 9f7c474..1593dc4 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)