From 4b637ec34af3774e70cdeee450e2e904d6d1ca35 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 3 Dec 2021 13:52:05 +0800 Subject: [PATCH] PyPy does not have PyDateTime_TimeZone_UTC Fixes https://github.com/psycopg/psycopg2/issues/1398 --- psycopg/typecast_datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/typecast_datetime.c b/psycopg/typecast_datetime.c index 44e1d315..b105a4c4 100644 --- a/psycopg/typecast_datetime.c +++ b/psycopg/typecast_datetime.c @@ -103,7 +103,7 @@ _parse_inftz(const char *str, PyObject *curs) goto exit; } -#if PY_VERSION_HEX < 0x03070000 +#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x03070000 { PyObject *tzoff; if (!(tzoff = PyDelta_FromDSU(0, 0, 0))) { goto exit; }