mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
regrtest: Fix module.__path__
Issue #26538: libregrtest: Fix setup_tests() to keep module.__path__ type (_NamespacePath), don't convert to a list. Add _NamespacePath.__setitem__() method to importlib._bootstrap_external.
This commit is contained in:
parent
6453e9ed0a
commit
82f04e2dfd
3 changed files with 945 additions and 933 deletions
|
@ -41,8 +41,8 @@ def setup_tests(ns):
|
|||
# the packages to prevent later imports to fail when the CWD is different.
|
||||
for module in sys.modules.values():
|
||||
if hasattr(module, '__path__'):
|
||||
module.__path__ = [os.path.abspath(path)
|
||||
for path in module.__path__]
|
||||
for index, path in enumerate(module.__path__):
|
||||
module.__path__[index] = os.path.abspath(path)
|
||||
if hasattr(module, '__file__'):
|
||||
module.__file__ = os.path.abspath(module.__file__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue