diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-17 21:11:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-17 21:11:28 (GMT) |
commit | 786a4e1cef3eda8f434613d3801a5c7565fb5cd8 (patch) | |
tree | 44dd42ba58b40ccd7120246c5fadfebbac3bc993 /Python/dynload_win.c | |
parent | 7309cca1471d556c139896dd8057d1feba378113 (diff) | |
download | cpython-786a4e1cef3eda8f434613d3801a5c7565fb5cd8.zip cpython-786a4e1cef3eda8f434613d3801a5c7565fb5cd8.tar.gz cpython-786a4e1cef3eda8f434613d3801a5c7565fb5cd8.tar.bz2 |
bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
(cherry picked from commit 24fe46081be3d1c01b3d21cb39bc3492ab4485a3)
Co-authored-by: shireenrao <shireenrao@gmail.com>
Diffstat (limited to 'Python/dynload_win.c')
-rw-r--r-- | Python/dynload_win.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 457d47f..2f28c3c 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -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( |