summaryrefslogtreecommitdiff
path: root/setuptools/command/editable_wheel.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-24 10:31:38 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-24 10:31:38 +0100
commitc0d9f43bcd3140fb4213d57675ae9beaec5607a3 (patch)
treed7f177bc1ee048b86d4b09cdec12ed945d7be8dd /setuptools/command/editable_wheel.py
parentaf1ff35b3715b5f2baf4b2fbe22a818b471b4513 (diff)
parent52bf418dedc7fa9a7fa2e3c641b414eda67f5c3c (diff)
downloadpython-setuptools-git-c0d9f43bcd3140fb4213d57675ae9beaec5607a3.tar.gz
Prevent accidental name matching in editable hooks (#3562)
Diffstat (limited to 'setuptools/command/editable_wheel.py')
-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))