diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-09-23 18:43:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 18:43:45 (GMT) |
commit | 2e4dd336e5b50fd30947fdecb605ddcd71f7f6f5 (patch) | |
tree | 7b8e1b98c94d77ffcdcfc61645c6b40f5ebd44ab /Modules/_testcapimodule.c | |
parent | 9c4eac7f02ddcf32fc1cdaf7c08c37fe9718c1fb (diff) | |
download | cpython-2e4dd336e5b50fd30947fdecb605ddcd71f7f6f5.zip cpython-2e4dd336e5b50fd30947fdecb605ddcd71f7f6f5.tar.gz cpython-2e4dd336e5b50fd30947fdecb605ddcd71f7f6f5.tar.bz2 |
bpo-30155: Add macros to get tzinfo from datetime instances (GH-21633)
Add PyDateTime_DATE_GET_TZINFO() and PyDateTime_TIME_GET_TZINFO()
macros.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 7536d29..0e09877 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2677,8 +2677,9 @@ test_PyDateTime_DATE_GET(PyObject *self, PyObject *obj) minute = PyDateTime_DATE_GET_MINUTE(obj); second = PyDateTime_DATE_GET_SECOND(obj); microsecond = PyDateTime_DATE_GET_MICROSECOND(obj); + PyObject *tzinfo = PyDateTime_DATE_GET_TZINFO(obj); - return Py_BuildValue("(llll)", hour, minute, second, microsecond); + return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo); } static PyObject * @@ -2690,8 +2691,9 @@ test_PyDateTime_TIME_GET(PyObject *self, PyObject *obj) minute = PyDateTime_TIME_GET_MINUTE(obj); second = PyDateTime_TIME_GET_SECOND(obj); microsecond = PyDateTime_TIME_GET_MICROSECOND(obj); + PyObject *tzinfo = PyDateTime_TIME_GET_TZINFO(obj); - return Py_BuildValue("(llll)", hour, minute, second, microsecond); + return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo); } static PyObject * |