summaryrefslogtreecommitdiff
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-06 02:39:42 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-06 02:39:42 +0200
commit0aeb34c31cc7bfc0c0fd5595b017e3f9dc0a93ef (patch)
treef08a5f5ddbd1f144edc43da6ffec6f6dd8356a3e /Python/import.c
parent11b74a5668d0af875d4af036b6e6e0007c51afe3 (diff)
downloadcpython-0aeb34c31cc7bfc0c0fd5595b017e3f9dc0a93ef.tar.gz
Fix find_module_path(): make the string ready
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 9f094c0da0..5f84ac2f74 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);