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 May 19, 2022
1 parent 3560be7 commit d931716
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions setuptools/command/editable_wheel.py
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 d931716

Please sign in to comment.