Skip to content

Commit

Permalink
Avoid adding PathEntryFinder if not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jun 15, 2022
1 parent 7c8f330 commit 3434415
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions setuptools/command/editable_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ def find_module(cls, fullname):
def install():
if not any(finder == _EditableFinder for finder in sys.meta_path):
sys.meta_path.append(_EditableFinder)
if not NAMESPACES:
return
if not any(hook == _EditableNamespaceFinder._path_hook for hook in sys.path_hooks):
# PathEntryFinder is needed to create NamespaceSpec without private APIS
sys.path_hooks.append(_EditableNamespaceFinder._path_hook)
Expand Down

0 comments on commit 3434415

Please sign in to comment.