From: Antoine Pitrou Date: Tue, 15 Nov 2011 19:40:55 +0000 (+0100) Subject: Fix regression under Windows following b75b41237380 (from issue #13392) X-Git-Tag: v3.3.0a1~837 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d8f3f451c45d01703f933a93766ecaff8018675;p=thirdparty%2FPython%2Fcpython.git Fix regression under Windows following b75b41237380 (from issue #13392) --- diff --git a/Python/import.c b/Python/import.c index 3c3e504e284a..64197d7a48e7 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1267,6 +1267,11 @@ write_compiled_module(PyCodeObject *co, PyObject *cpathname, PyErr_Clear(); return; } + if (PyUnicode_CopyCharacters(cpathname_tmp, 0, + cpathname, 0, cpathname_len) < 0) { + PyErr_Clear(); + return; + } PyUnicode_WriteChar(cpathname_tmp, cpathname_len + 0, '.'); PyUnicode_WriteChar(cpathname_tmp, cpathname_len + 1, 't'); PyUnicode_WriteChar(cpathname_tmp, cpathname_len + 2, 'm');