Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the error code reported by :func:`winreg.ExpandEnvironmentStrings` when
expanding the string fails.
2 changes: 1 addition & 1 deletion PC/winreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ winreg_ExpandEnvironmentStrings_impl(PyObject *module, const wchar_t *string)
rc = ExpandEnvironmentStringsW(string, retValue, retValueSize);
if (rc == 0) {
PyMem_Free(retValue);
return PyErr_SetFromWindowsErrWithFunction(retValueSize,
return PyErr_SetFromWindowsErrWithFunction(0,
"ExpandEnvironmentStrings");
}
o = PyUnicode_FromWideChar(retValue, -1);
Expand Down
Loading