pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/24fe46081be3d1c01b3d21cb39bc3492ab4485a3

9af82350aeda.css" /> bpo-36266: Add module name in ImportError when DLL not found on Windo… · python/cpython@24fe460 · GitHub
Skip to content

Commit 24fe460

Browse files
shireenraozooba
authored andcommitted
bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
1 parent 4558563 commit 24fe460

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the module name in the formatted error message when DLL load fail happens during module import in ``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati.

Python/dynload_win.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
240240
This should not happen if called correctly. */
241241
if (theLength == 0) {
242242
message = PyUnicode_FromFormat(
243-
"DLL load failed with error code %u",
244-
errorCode);
243+
"DLL load failed with error code %u while importing %s",
244+
errorCode, shortname);
245245
} else {
246246
/* For some reason a \r\n
247247
is appended to the text */
@@ -251,8 +251,8 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
251251
theLength -= 2;
252252
theInfo[theLength] = '\0';
253253
}
254-
message = PyUnicode_FromString(
255-
"DLL load failed: ");
254+
message = PyUnicode_FromFormat(
255+
"DLL load failed while importing %s: ", shortname);
256256

257257
PyUnicode_AppendAndDel(&message,
258258
PyUnicode_FromWideChar(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy