summaryrefslogtreecommitdiff
path: root/setuptools/tests/contexts.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-04-17 00:45:07 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-06-15 16:43:56 +0100
commit3c71c872d9e23997d383e2adafe04d4cb1723109 (patch)
tree4b578846aa31e6c0dca06aa5212681e0f846cfa0 /setuptools/tests/contexts.py
parent99cf706cffe065a941270991808d412954067973 (diff)
downloadpython-setuptools-git-3c71c872d9e23997d383e2adafe04d4cb1723109.tar.gz
Correctly handle namespace spec via PathEntryFinder
Diffstat (limited to 'setuptools/tests/contexts.py')
-rw-r--r--setuptools/tests/contexts.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/setuptools/tests/contexts.py b/setuptools/tests/contexts.py
index 019da824..7ddbc780 100644
--- a/setuptools/tests/contexts.py
+++ b/setuptools/tests/contexts.py
@@ -127,13 +127,13 @@ def session_locked_tmp_dir(request, tmp_path_factory, name):
@contextlib.contextmanager
def save_paths():
- """Make sure initial ``sys.path`` and ``sys.meta_path`` are preserved"""
- prev_paths = sys.path[:], sys.meta_path[:]
+ """Make sure ``sys.path``, ``sys.meta_path`` and ``sys.path_hooks`` are preserved"""
+ prev = sys.path[:], sys.meta_path[:], sys.path_hooks[:]
try:
yield
finally:
- sys.path, sys.meta_path = prev_paths
+ sys.path, sys.meta_path, sys.path_hooks = prev
@contextlib.contextmanager