diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:05:12 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:05:12 (GMT) |
commit | ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3 (patch) | |
tree | 2c13c21d1c81e089ab5b0467bc8294ecb7a89627 /Lib | |
parent | fe19d21815632ba179e32ba1517c1337ac407e97 (diff) | |
download | cpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.zip cpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.tar.gz cpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.tar.bz2 |
Fix imp.cache_from_source() if the directory name contains a dot
If the directory name contains a dot but not the filename, don't strip at the
dot.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_imp.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index d745ae9..83e17d3 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -210,6 +210,10 @@ class PEP3147Tests(unittest.TestCase): self.assertEqual( imp.cache_from_source('/foo/bar/baz/qux.py', True), '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)) + # Directory with a dot, filename without dot + self.assertEqual( + imp.cache_from_source('/foo.bar/file', True), + '/foo.bar/__pycache__/file{}.pyc'.format(self.tag)) def test_cache_from_source_optimized(self): # Given the path to a .py file, return the path to its PEP 3147 |