diff -r adb6b029b102 Lib/importlib/_bootstrap_external.py --- a/Lib/importlib/_bootstrap_external.py Wed Mar 09 15:02:31 2016 +0100 +++ b/Lib/importlib/_bootstrap_external.py Fri Mar 11 12:41:53 2016 +0100 @@ -971,6 +971,9 @@ class _NamespacePath: def __iter__(self): return iter(self._recalculate()) + def __setitem__(self, index, path): + self._path[index] = path + def __len__(self): return len(self._recalculate()) diff -r adb6b029b102 Lib/test/libregrtest/setup.py --- a/Lib/test/libregrtest/setup.py Wed Mar 09 15:02:31 2016 +0100 +++ b/Lib/test/libregrtest/setup.py Fri Mar 11 12:41:53 2016 +0100 @@ -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__)