summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-23 08:48:40 (GMT)
committerGitHub <noreply@github.com>2019-08-23 08:48:40 (GMT)
commit5c77730300c0358d7bebd2bb39ea5d10222a3d9a (patch)
treeb01ab4ba423260b3c8cd83be9ff419da1b42d89e /Modules
parentb6341e676af2f58f3ad9b51a0d2fb7db5a3428e3 (diff)
downloadcpython-5c77730300c0358d7bebd2bb39ea5d10222a3d9a.zip
cpython-5c77730300c0358d7bebd2bb39ea5d10222a3d9a.tar.gz
cpython-5c77730300c0358d7bebd2bb39ea5d10222a3d9a.tar.bz2
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal (cherry picked from commit 4be11c009abe88175fa164b45e4838e7267dfa97) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_datetimemodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index beb1c3c..e6abfc2 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
@@ -3748,7 +3749,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);