mirror of
https://github.com/python/cpython.git
synced 2025-09-11 11:17:16 +00:00
Issue #15973: Fixed segmentation fault on timezone comparison to other types.
This commit is contained in:
parent
4e12ad19c9
commit
3ec153681e
3 changed files with 11 additions and 3 deletions
|
@ -1821,6 +1821,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