python-psycopg2/python38.patch
Devrim Gündüz 6eb594a4f9 Revert "- Update to 2.8.3"
This reverts commit 21b3c37541.
2019-09-09 15:14:57 +01:00

24 lines
695 B
Diff

diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index 5deaa16..f35d574 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -677,6 +677,10 @@ psyco_set_error(PyObject *exc, cursorObject *curs, const char *msg)
static int
psyco_is_main_interp(void)
{
+#if PY_VERSION_HEX >= 0x03080000
+ /* tested with Python 3.8.0a2 */
+ return _PyInterpreterState_Get() == PyInterpreterState_Main();
+#else
static PyInterpreterState *main_interp = NULL; /* Cached reference */
PyInterpreterState *interp;
@@ -692,6 +696,7 @@ psyco_is_main_interp(void)
main_interp = interp;
assert (main_interp);
return psyco_is_main_interp();
+#endif
}