mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
#15421: fix an OverflowError in Calendar.itermonthdates() after datetime.MAXYEAR. Patch by Cédric Krier.
This commit is contained in:
parent
e418d76089
commit
85710a40e7
3 changed files with 14 additions and 1 deletions
|
@ -5,6 +5,7 @@ from test import support
|
|||
from test.script_helper import assert_python_ok
|
||||
import time
|
||||
import locale
|
||||
import datetime
|
||||
|
||||
result_2004_text = """
|
||||
2004
|
||||
|
@ -265,6 +266,11 @@ class CalendarTestCase(unittest.TestCase):
|
|||
new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
|
||||
self.assertEqual(old_october, new_october)
|
||||
|
||||
def test_itermonthdates(self):
|
||||
# ensure itermonthdates doesn't overflow after datetime.MAXYEAR
|
||||
# see #15421
|
||||
list(calendar.Calendar().itermonthdates(datetime.MAXYEAR, 12))
|
||||
|
||||
|
||||
class MonthCalendarTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue