Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f82b9371
Kaydet (Commit)
f82b9371
authored
Eyl 21, 2012
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#15421: merge with 3.2.
üst
050a61f8
85710a40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
calendar.py
Lib/calendar.py
+5
-1
test_calendar.py
Lib/test/test_calendar.py
+6
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/calendar.py
Dosyayı görüntüle @
f82b9371
...
...
@@ -161,7 +161,11 @@ class Calendar(object):
oneday
=
datetime
.
timedelta
(
days
=
1
)
while
True
:
yield
date
date
+=
oneday
try
:
date
+=
oneday
except
OverflowError
:
# Adding one day could fail after datetime.MAXYEAR
break
if
date
.
month
!=
month
and
date
.
weekday
()
==
self
.
firstweekday
:
break
...
...
Lib/test/test_calendar.py
Dosyayı görüntüle @
f82b9371
...
...
@@ -6,6 +6,7 @@ from test.script_helper import assert_python_ok
import
time
import
locale
import
sys
import
datetime
result_2004_01_text
=
"""
January 2004
...
...
@@ -464,6 +465,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
):
...
...
Misc/NEWS
Dosyayı görüntüle @
f82b9371
...
...
@@ -36,6 +36,9 @@ Core and Builtins
Library
-------
- Issue #15421: fix an OverflowError in Calendar.itermonthdates() after
datetime.MAXYEAR. Patch by Cédric Krier.
- Issue #15970: xml.etree.ElementTree now serializes correctly the empty HTML
elements '
meta
' and '
param
'.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment