Closes #15973: fix a segmentation fault when comparing timezone objects.

This commit is contained in:
Georg Brandl 2012-09-22 09:23:12 +02:00
parent fd296ff5d6
commit 0085a24075
4 changed files with 13 additions and 0 deletions

View file

@ -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):