summaryrefslogtreecommitdiff
path: root/psycopg/typecast_datetime.c
diff options
context:
space:
mode:
authorJohn Vandenberg <jayvdb@gmail.com>2021-12-03 13:52:05 +0800
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-12-03 11:29:21 +0100
commit4b637ec34af3774e70cdeee450e2e904d6d1ca35 (patch)
tree2406002a03206d476abf808d7e4d5557330e35d1 /psycopg/typecast_datetime.c
parent53bda13afa1aea458faec82145d0a5f511267bd5 (diff)
downloadpsycopg2-4b637ec34af3774e70cdeee450e2e904d6d1ca35.tar.gz
PyPy does not have PyDateTime_TimeZone_UTC
Fixes https://github.com/psycopg/psycopg2/issues/1398
Diffstat (limited to 'psycopg/typecast_datetime.c')
-rw-r--r--psycopg/typecast_datetime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/typecast_datetime.c b/psycopg/typecast_datetime.c
index 44e1d31..b105a4c 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; }