summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-02-16 23:12:00 (GMT)
committerBrett Cannon <brett@python.org>2012-02-16 23:12:00 (GMT)
commitf58d45c649c1738870ac85887599850fd2bbf157 (patch)
treec16b0f2c43c52dd82c5468d11747bb515fc91416 /Lib/importlib/test
parent22e7c88057ee91ded2bd9853a6b67846c34d392f (diff)
downloadcpython-f58d45c649c1738870ac85887599850fd2bbf157.zip
cpython-f58d45c649c1738870ac85887599850fd2bbf157.tar.gz
cpython-f58d45c649c1738870ac85887599850fd2bbf157.tar.bz2
Tweak the handling of the empty string in sys.path for importlib.
It seems better to cache the finder for the cwd under its full path insetad of '' in case the cwd changes. Otherwise FileFinder needs to dynamically change itself based on whether it is given '' instead of caching a finder for every change to the cwd.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r--Lib/importlib/test/import_/test_path.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/test/import_/test_path.py b/Lib/importlib/test/import_/test_path.py
index b28f25d..61fe226 100644
--- a/Lib/importlib/test/import_/test_path.py
+++ b/Lib/importlib/test/import_/test_path.py
@@ -82,7 +82,7 @@ class FinderTests(unittest.TestCase):
with util.import_state(path=[path], path_hooks=[hook]):
loader = machinery.PathFinder.find_module(module)
self.assertIs(loader, importer)
- self.assertIn('', sys.path_importer_cache)
+ self.assertIn(os.getcwd(), sys.path_importer_cache)
class DefaultPathFinderTests(unittest.TestCase):