summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_calendar.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-09-21 14:26:35 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-09-21 14:26:35 (GMT)
commit85710a40e7e9eab86060bedc3762ccf9ca8d26ca (patch)
tree34df432ef5160f2bff895cca080e63760357d376 /Lib/test/test_calendar.py
parente418d760897cc6f6f4dedb364f80f3f52525ffa6 (diff)
downloadcpython-85710a40e7e9eab86060bedc3762ccf9ca8d26ca.zip
cpython-85710a40e7e9eab86060bedc3762ccf9ca8d26ca.tar.gz
cpython-85710a40e7e9eab86060bedc3762ccf9ca8d26ca.tar.bz2
#15421: fix an OverflowError in Calendar.itermonthdates() after datetime.MAXYEAR. Patch by Cédric Krier.
Diffstat (limited to 'Lib/test/test_calendar.py')
-rw-r--r--Lib/test/test_calendar.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index d3093ac..948a119 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -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):