diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-25 15:02:36 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-25 15:02:36 +0300 |
| commit | ecb90182f59c4929a395759896d1abea4e408f39 (patch) | |
| tree | e58592342e441945c079ca185ab8f604043d4138 | |
| parent | a6eba11f866f0575e18398d6fdc2cbd47ccb2495 (diff) | |
| parent | 7ff51bd2b8b8407942e3bab2c9267cc8b95f06be (diff) | |
| download | cpython-git-ecb90182f59c4929a395759896d1abea4e408f39.tar.gz | |
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.
| -rw-r--r-- | Lib/calendar.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_calendar.py | 3 | ||||
| -rw-r--r-- | Misc/NEWS | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py index 92149b7bfe..07594f3a83 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -314,7 +314,7 @@ class TextCalendar(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): """ diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 6c7cdd1bac..2bc4feebbd 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -409,8 +409,7 @@ class OutputTestCase(unittest.TestCase): def test_prmonth(self): with support.captured_stdout() as out: calendar.TextCalendar().prmonth(2004, 1) - output = out.getvalue().strip() - self.assertEqual(output, result_2004_01_text.strip()) + self.assertEqual(out.getvalue(), result_2004_01_text) def test_pryear(self): with support.captured_stdout() as out: @@ -29,6 +29,10 @@ Core and Builtins 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. Based on patch by Kaarle Ritvanen. |
