[Python-checkins] cpython: Fix imp.cache_from_source() if the directory name contains a dot (original) (raw)

victor.stinner python-checkins at python.org
Sun Mar 20 04:14:04 CET 2011


http://hg.python.org/cpython/rev/238cbd559e9c changeset: 68737:238cbd559e9c user: Victor Stinner <victor.stinner at haypocalc.com> date: Mon Mar 14 15:05:12 2011 -0400 summary: 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.

files: Lib/test/test_imp.py Python/import.c

diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -210,6 +210,10 @@ self.assertEqual( imp.cache_from_source('/foo/bar/baz/qux.py', True), '/foo/bar/baz/pycache/qux.{}.pyc'.format(self.tag))

diff --git a/Python/import.c b/Python/import.c --- a/Python/import.c +++ b/Python/import.c @@ -943,12 +943,12 @@ Py_UNICODE_strcat(buf, CACHEDIR_UNICODE); i += Py_UNICODE_strlen(CACHEDIR_UNICODE) - 1; buf[i++] = sep;

-- Repository URL: http://hg.python.org/cpython



More information about the Python-checkins mailing list