summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-24 09:44:52 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-24 09:44:52 +0100
commit1387232226db86d22135907302de1cff0a6b0989 (patch)
treed123b606e6d2178fbe53eae502959d9195debac7 /setuptools/command
parent753b195877ea35fbf3e9c06818a51cffeda48ea3 (diff)
downloadpython-setuptools-git-1387232226db86d22135907302de1cff0a6b0989.tar.gz
Prevent accidental partial name matching in editable hooks
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/editable_wheel.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py
index b908298f..d05c3a75 100644
--- a/setuptools/command/editable_wheel.py
+++ b/setuptools/command/editable_wheel.py
@@ -758,7 +758,7 @@ class _EditableFinder: # MetaPathFinder
@classmethod
def find_spec(cls, fullname, path=None, target=None):
for pkg, pkg_path in reversed(list(MAPPING.items())):
- if fullname.startswith(pkg):
+ if fullname == pkg or fullname.startswith(f"{{pkg}}."):
rest = fullname.replace(pkg, "", 1).strip(".").split(".")
return cls._find_spec(fullname, Path(pkg_path, *rest))