summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-01-28 10:00:16 (GMT)
committerGitHub <noreply@github.com>2020-01-28 10:00:16 (GMT)
commit46735c7e101753769e31c69a36d0030bb056a162 (patch)
tree9e85cecdbcabff29efc3eaf351cc4ca6d308bf4a
parent595b516965ee88b817dc1b3d7713e1f3f263634d (diff)
downloadcpython-46735c7e101753769e31c69a36d0030bb056a162.zip
cpython-46735c7e101753769e31c69a36d0030bb056a162.tar.gz
cpython-46735c7e101753769e31c69a36d0030bb056a162.tar.bz2
bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)
(cherry picked from commit 13c1c3556f2c12d0be2af890fabfbf44280b845c) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
-rw-r--r--Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst2
-rw-r--r--Modules/_ctypes/callproc.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst b/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst
new file mode 100644
index 0000000..025b7e9
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst
@@ -0,0 +1,2 @@
+Improve the error message when attempting to load a DLL with unresolved
+dependencies.
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 77492e6..4027bdb 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -1311,8 +1311,9 @@ static PyObject *load_library(PyObject *self, PyObject *args)
if (err == ERROR_MOD_NOT_FOUND) {
PyErr_Format(PyExc_FileNotFoundError,
- ("Could not find module '%.500S'. Try using "
- "the full path with constructor syntax."),
+ ("Could not find module '%.500S' (or one of its "
+ "dependencies). Try using the full path with "
+ "constructor syntax."),
nameobj);
return NULL;
} else if (err) {