summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-06 00:39:42 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-06 00:39:42 (GMT)
commit46084bad8826e547b66496867a5ba0e21c0b4a45 (patch)
treeeddc398c668706e7b6cf795157d07a12be365a5a /Python
parentc729b8e92f044688e1b9d1cb24541c6f3d297415 (diff)
downloadcpython-46084bad8826e547b66496867a5ba0e21c0b4a45.zip
cpython-46084bad8826e547b66496867a5ba0e21c0b4a45.tar.gz
cpython-46084bad8826e547b66496867a5ba0e21c0b4a45.tar.bz2
Fix find_module_path(): make the string ready
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 9f094c0..5f84ac2 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1785,6 +1785,9 @@ find_module_path(PyObject *fullname, PyObject *name, PyObject *path,
else
return 0;
+ if (PyUnicode_READY(path_unicode))
+ return -1;
+
len = PyUnicode_GET_LENGTH(path_unicode);
if (!PyUnicode_AsUCS4(path_unicode, buf, Py_ARRAY_LENGTH(buf), 1)) {
Py_DECREF(path_unicode);