]> granicus.if.org Git - python/commitdiff
Fix find_module_path(): make the string ready
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 6 Oct 2011 00:39:42 +0000 (02:39 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 6 Oct 2011 00:39:42 +0000 (02:39 +0200)
Python/import.c

index 9f094c0da08bf04593d52ca55724cf4523788e5b..5f84ac2f745a7a0e6817c35e66863dabf1e68cd1 100644 (file)
@@ -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);