commit | 0085a2407574a4af46019bee279895bdafbd76b8 | [log] [tgz] |
---|---|---|
author | Georg Brandl <georg@python.org> | Sat Sep 22 09:23:12 2012 +0200 |
committer | Georg Brandl <georg@python.org> | Sat Sep 22 09:23:12 2012 +0200 |
tree | adfe988557488cc52e34b16bb971f8a8727f1ae6 | |
parent | fd296ff5d6436ad3a782cca816783f05acd9fe78 [diff] [blame] |
Closes #15973: fix a segmentation fault when comparing timezone objects.
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 @@ return (self._offset, self._name) def __eq__(self, other): + if type(other) != timezone: + return False return self._offset == other._offset def __hash__(self):