Core and Builtins
-----------------
+- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
+
- Issue #18038: SyntaxError raised during compilation sources with illegal
encoding now always contains an encoding name.
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;