mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Closes #15973: fix a segmentation fault when comparing timezone objects.
This commit is contained in:
parent
fd296ff5d6
commit
0085a24075
4 changed files with 13 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue