mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 12:23:42 +03:00
Fixed building with Python 3.8
Not released yet, and using an internal API, so for the moment better not declare it supported. Close #854
This commit is contained in:
parent
be7e1916d7
commit
c929f20048
|
@ -408,6 +408,10 @@ psyco_set_error(PyObject *exc, cursorObject *curs, const char *msg)
|
||||||
static int
|
static int
|
||||||
psyco_is_main_interp(void)
|
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 */
|
static PyInterpreterState *main_interp = NULL; /* Cached reference */
|
||||||
PyInterpreterState *interp;
|
PyInterpreterState *interp;
|
||||||
|
|
||||||
|
@ -423,6 +427,7 @@ psyco_is_main_interp(void)
|
||||||
main_interp = interp;
|
main_interp = interp;
|
||||||
assert (main_interp);
|
assert (main_interp);
|
||||||
return psyco_is_main_interp();
|
return psyco_is_main_interp();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* psyco_GetDecimalType
|
/* psyco_GetDecimalType
|
||||||
|
|
Loading…
Reference in New Issue
Block a user