mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
(cherry picked from commit 24fe46081b
)
Co-authored-by: shireenrao <shireenrao@gmail.com>
This commit is contained in:
parent
7309cca147
commit
786a4e1cef
2 changed files with 5 additions and 4 deletions
|
@ -258,8 +258,8 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
|
|||
This should not happen if called correctly. */
|
||||
if (theLength == 0) {
|
||||
message = PyUnicode_FromFormat(
|
||||
"DLL load failed with error code %u",
|
||||
errorCode);
|
||||
"DLL load failed with error code %u while importing %s",
|
||||
errorCode, shortname);
|
||||
} else {
|
||||
/* For some reason a \r\n
|
||||
is appended to the text */
|
||||
|
@ -269,8 +269,8 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
|
|||
theLength -= 2;
|
||||
theInfo[theLength] = '\0';
|
||||
}
|
||||
message = PyUnicode_FromString(
|
||||
"DLL load failed: ");
|
||||
message = PyUnicode_FromFormat(
|
||||
"DLL load failed while importing %s: ", shortname);
|
||||
|
||||
PyUnicode_AppendAndDel(&message,
|
||||
PyUnicode_FromWideChar(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue