Backport of 52811:
Bug #1599782: Fix segfault on bsddb.db.DB().type().
The problem is that _DB_get_type() can't be called without the GIL
because it calls a bunch of PyErr_* APIs when an error occurs.
There were no other cases in this file that it was called without the GIL.
Removing the BEGIN/END THREAD around _DB_get_type() made everything work.
diff --git a/Misc/NEWS b/Misc/NEWS
index 28543f6..231004d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -276,6 +276,8 @@
Extension Modules
-----------------
+- Bug #1599782: fix segfault on bsddb.db.DB().type().
+
- Fix bugs in ctypes:
- anonymous structure fields that have a bit-width specified did not work
- cast function did not accept c_char_p or c_wchar_p instances as first arg