mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-120268: Prohibit passing `None to _pydatetime.date.fromtimestamp` (#120269)
This makes the pure Python implementation consistent with the C implementation.
This commit is contained in:
parent
7c016deae6
commit
34f5ae69fe
3 changed files with 9 additions and 0 deletions
|
|
@ -1336,6 +1336,11 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
|||
self.assertRaises(OverflowError, self.theclass.fromtimestamp,
|
||||
insane)
|
||||
|
||||
def test_fromtimestamp_with_none_arg(self):
|
||||
# See gh-120268 for more details
|
||||
with self.assertRaises(TypeError):
|
||||
self.theclass.fromtimestamp(None)
|
||||
|
||||
def test_today(self):
|
||||
import time
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue