diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-08-22 19:24:25 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-22 19:24:25 (GMT) |
commit | 4be11c009abe88175fa164b45e4838e7267dfa97 (patch) | |
tree | 19f0c688af902ba0403f3c5c0d5e51b4949e66d7 /Modules | |
parent | 8889627b53e1eea2e32590f1867fbb0b0fc7407f (diff) | |
download | cpython-4be11c009abe88175fa164b45e4838e7267dfa97.zip cpython-4be11c009abe88175fa164b45e4838e7267dfa97.tar.gz cpython-4be11c009abe88175fa164b45e4838e7267dfa97.tar.bz2 |
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
https://bugs.python.org/issue37915
Automerge-Triggered-By: @pablogsal
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_datetimemodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 6d28b3e..56eaccd 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -32,6 +32,7 @@ #define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType) #define PyTZInfo_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TZInfoType) +#define PyTimezone_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeZoneType) /*[clinic input] module datetime @@ -3745,7 +3746,7 @@ timezone_richcompare(PyDateTime_TimeZone *self, { if (op != Py_EQ && op != Py_NE) Py_RETURN_NOTIMPLEMENTED; - if (!PyTZInfo_Check(other)) { + if (!PyTimezone_Check(other)) { Py_RETURN_NOTIMPLEMENTED; } return delta_richcompare(self->offset, other->offset, op); |