[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 20:06:56 EDT 2018


https://github.com/python/cpython/commit/21a808230aa33741f1dd9bf38f0e283c1b72210e
commit: 21a808230aa33741f1dd9bf38f0e283c1b72210e
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-09-12T17:06:53-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 b22546dd5c9f..6e57b6010f77 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -603,9 +603,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