[Python-checkins] closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)

Miss Islington (bot) webhook-mailer at python.org
Wed Sep 12 19:54:14 EDT 2018


https://github.com/python/cpython/commit/ea2fcd3db65b796ad3eda1619a903cefb1aa9363
commit: ea2fcd3db65b796ad3eda1619a903cefb1aa9363
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-09-12T16:54:10-07:00
summary:

closes bpo-34654: Tolerate + at the beginning of large years. (GH-9238)

(cherry picked from commit e1a34ceb541ef87e03bb428630097dacc9c658e5)

Co-authored-by: Benjamin Peterson <benjamin at python.org>

files:
M Lib/test/test_time.py

diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 9acd1d497ee8..62abd891aafa 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -703,9 +703,9 @@ def test_year(self, fmt=None, func=None):
         self.assertEqual(func(9999), fmt % 9999)
 
     def test_large_year(self):
-        self.assertEqual(self.yearstr(12345), '12345')
-        self.assertEqual(self.yearstr(123456789), '123456789')
-        self.assertEqual(self.yearstr(TIME_MAXYEAR), str(TIME_MAXYEAR))
+        self.assertEqual(self.yearstr(12345).lstrip('+'), '12345')
+        self.assertEqual(self.yearstr(123456789).lstrip('+'), '123456789')
+        self.assertEqual(self.yearstr(TIME_MAXYEAR).lstrip('+'), str(TIME_MAXYEAR))
         self.assertRaises(OverflowError, self.yearstr, TIME_MAXYEAR + 1)
 
     def test_negative(self):



More information about the Python-checkins mailing list