Commit d2f39cef authored by Serhiy Storchaka's avatar Serhiy Storchaka

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.
parent aeacde7b
...@@ -312,7 +312,7 @@ class TextCalendar(Calendar): ...@@ -312,7 +312,7 @@ class TextCalendar(Calendar):
""" """
Print a month's calendar. Print a month's calendar.
""" """
print(self.formatmonth(theyear, themonth, w, l), end=' ') print(self.formatmonth(theyear, themonth, w, l), end='')
def formatmonth(self, theyear, themonth, w=0, l=0): def formatmonth(self, theyear, themonth, w=0, l=0):
""" """
......
...@@ -409,8 +409,7 @@ class OutputTestCase(unittest.TestCase): ...@@ -409,8 +409,7 @@ class OutputTestCase(unittest.TestCase):
def test_prmonth(self): def test_prmonth(self):
with support.captured_stdout() as out: with support.captured_stdout() as out:
calendar.TextCalendar().prmonth(2004, 1) calendar.TextCalendar().prmonth(2004, 1)
output = out.getvalue().strip() self.assertEqual(out.getvalue(), result_2004_01_text)
self.assertEqual(output, result_2004_01_text.strip())
def test_pryear(self): def test_pryear(self):
with support.captured_stdout() as out: with support.captured_stdout() as out:
......
...@@ -113,6 +113,10 @@ Core and Builtins ...@@ -113,6 +113,10 @@ Core and Builtins
Library Library
------- -------
- 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.
- Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces. - Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces.
Based on patch by Kaarle Ritvanen. Based on patch by Kaarle Ritvanen.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment