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/_zoneinfo.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/_zoneinfo.c')
-rw-r--r-- | Modules/_zoneinfo.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index 2cee65f..bee59b8 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -484,9 +484,7 @@ zoneinfo_tzname(PyObject *self, PyObject *dt) return tti->tzname; } -#define HASTZINFO(p) (((_PyDateTime_BaseTZInfo *)(p))->hastzinfo) -#define GET_DT_TZINFO(p) \ - (HASTZINFO(p) ? ((PyDateTime_DateTime *)(p))->tzinfo : Py_None) +#define GET_DT_TZINFO PyDateTime_DATE_GET_TZINFO static PyObject * zoneinfo_fromutc(PyObject *obj_self, PyObject *dt) |