diff options
author | Glyph <glyph@twistedmatrix.com> | 2017-12-12 03:12:54 -0800 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2018-01-10 22:53:43 +0000 |
commit | 632cfe0617080c8c169d006482772b4dc1e2398f (patch) | |
tree | 05914a138d07122e30a6167193da4368a3100548 | |
parent | ae227effe2bcc63cacbb2ee41a39345f0934e578 (diff) | |
download | psycopg2-632cfe0617080c8c169d006482772b4dc1e2398f.tar.gz |
define a "polyfill" inline for python 2 compatibility
-rw-r--r-- | psycopg/adapter_datetime.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index a78311e..b5135ef 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -93,6 +93,12 @@ error: return rv; } +#ifndef PyDateTime_DELTA_GET_DAYS +#define PyDateTime_DELTA_GET_DAYS(o) (o->days) +#define PyDateTime_DELTA_GET_SECONDS(o) (o->seconds) +#define PyDateTime_DELTA_GET_MICROSECONDS(o) (o->microseconds) +#endif + static PyObject * _pydatetime_string_delta(pydatetimeObject *self) { |