[Python-checkins] bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766)

Miss Islington (bot) webhook-mailer at python.org
Fri Nov 16 18:52:58 EST 2018

commit: 338d54f0a59dc5e5b6c9e7397340169f3a3f8ea4
branch: master
author: Stefano Rivera <github at rivera.za.net>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2018-11-16T15:52:52-08:00

bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules (GH-1766)

[Issue 28401](https://bugs.python.org/issue28401): Don't attempt to import the stable API extensions, they are not supported in PyDEBUG builds (which don't implement that ABI).


A Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst
M Python/dynload_shlib.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst
new file mode 100644
index 000000000000..8fbba7826df9
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-03-10-37-29.bpo-28401.RprDIg.rst	
@@ -0,0 +1,3 @@
+Debug builds will no longer to attempt to import extension modules built
+for the ABI as they were never compatible to begin with.
+Patch by Stefano Rivera.
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index feebd8976d0a..e5bddaab6caa 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -38,7 +38,9 @@ const char *_PyImport_DynLoadFiletab[] = {
 #else  /* !__CYGWIN__ */
     "." SOABI ".so",
+#ifndef Py_DEBUG
     ".abi" PYTHON_ABI_STRING ".so",
+#endif /* ! Py_DEBUG */
 #endif  /* __CYGWIN__ */

More information about the Python-checkins mailing list