From 46084bad8826e547b66496867a5ba0e21c0b4a45 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 6 Oct 2011 02:39:42 +0200 Subject: [PATCH] Fix find_module_path(): make the string ready --- Python/import.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.49.0