summaryrefslogtreecommitdiffstats
path: root/Lib/datetime.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-09-22 07:23:12 (GMT)
committerGeorg Brandl <georg@python.org>2012-09-22 07:23:12 (GMT)
commit0085a2407574a4af46019bee279895bdafbd76b8 (patch)
treeadfe988557488cc52e34b16bb971f8a8727f1ae6 /Lib/datetime.py
parentfd296ff5d6436ad3a782cca816783f05acd9fe78 (diff)
downloadcpython-0085a2407574a4af46019bee279895bdafbd76b8.zip
cpython-0085a2407574a4af46019bee279895bdafbd76b8.tar.gz
cpython-0085a2407574a4af46019bee279895bdafbd76b8.tar.bz2
Closes #15973: fix a segmentation fault when comparing timezone objects.
Diffstat (limited to 'Lib/datetime.py')
-rw-r--r--Lib/datetime.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/datetime.py b/Lib/datetime.py
index a15c6b0..f506e9a 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -1854,6 +1854,8 @@ class timezone(tzinfo):
return (self._offset, self._name)
def __eq__(self, other):
+ if type(other) != timezone:
+ return False
return self._offset == other._offset
def __hash__(self):