Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ecb9018

Browse files
Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
at the start of new line after printing a month's calendar. Patch by Xiang Zhang.
2 parents a6eba11 + 7ff51bd commit ecb9018

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def prmonth(self, theyear, themonth, w=0, l=0):
314314
"""
315315
Print a month's calendar.
316316
"""
317-
print(self.formatmonth(theyear, themonth, w, l), end=' ')
317+
print(self.formatmonth(theyear, themonth, w, l), end='')
318318

319319
def formatmonth(self, theyear, themonth, w=0, l=0):
320320
"""

Lib/test/test_calendar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ def test_prweek(self):
409409
def test_prmonth(self):
410410
with support.captured_stdout() as out:
411411
calendar.TextCalendar().prmonth(2004, 1)
412-
output = out.getvalue().strip()
413-
self.assertEqual(output, result_2004_01_text.strip())
412+
self.assertEqual(out.getvalue(), result_2004_01_text)
414413

415414
def test_pryear(self):
416415
with support.captured_stdout() as out:

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Core and Builtins
2929
Library
3030
-------
3131

32+
- Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
33+
at the start of new line after printing a month's calendar. Patch by
34+
Xiang Zhang.
35+
3236
- Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces.
3337
Based on patch by Kaarle Ritvanen.
3438

0 commit comments

Comments
 (0)