diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-25 12:03:59 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-25 12:03:59 (GMT) |
commit | 78d84d83263dd806fc2a9b9b6eb27ec38742e854 (patch) | |
tree | 92b07eb70418191f7e1cc71a07ea05b9789a65a0 /Lib | |
parent | da223e5cef42ffe200f0f1dbdb695e9f1c171ea7 (diff) | |
parent | ecb90182f59c4929a395759896d1abea4e408f39 (diff) | |
download | cpython-78d84d83263dd806fc2a9b9b6eb27ec38742e854.zip cpython-78d84d83263dd806fc2a9b9b6eb27ec38742e854.tar.gz cpython-78d84d83263dd806fc2a9b9b6eb27ec38742e854.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/calendar.py | 2 | ||||
-rw-r--r-- | Lib/test/test_calendar.py | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py index 92149b7..07594f3 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 6c7cdd1..2bc4fee 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: |