# HG changeset patch # Parent 341153f5fbd643d5596d47da9660452819e64698 diff -r 341153f5fbd6 -r 3a497a5284fd Python/dynload_win.c --- a/Python/dynload_win.c Mon Jun 10 11:46:35 2013 +0100 +++ b/Python/dynload_win.c Mon Jun 10 12:40:14 2013 +0100 @@ -262,8 +262,9 @@ theLength)); } if (message != NULL) { - PyErr_SetImportError(message, PyUnicode_FromString(shortname), - pathname); + PyObject *shortname_obj = PyUnicode_FromString(shortname); + PyErr_SetImportError(message, shortname_obj, pathname); + Py_XDECREF(shortname_obj); Py_DECREF(message); } return NULL;