Skip to content

Commit 0637c29

Browse files
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 35bc090 commit 0637c29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_strptime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def __init__(self, locale_time=None):
290290
'f': r"(?P<f>[0-9]{1,6})",
291291
'H': r"(?P<H>2[0-3]|[0-1][0-9]|[0-9])",
292292
'I': r"(?P<I>1[0-2]|0[1-9]|[1-9]| [1-9])",
293-
'G': r"(?P<G>[0-9]{4})",
293+
'G': r"(?P<G>[0-9][0-9][0-9][0-9])",
294294
'j': r"(?P<j>36[0-6]|3[0-5][0-9]|[1-2][0-9][0-9]|0[1-9][0-9]|00[1-9]|[1-9][0-9]|0[1-9]|[1-9])",
295295
'm': r"(?P<m>1[0-2]|0[1-9]|[1-9])",
296296
'M': r"(?P<M>[0-5][0-9]|[0-9])",
@@ -300,7 +300,7 @@ def __init__(self, locale_time=None):
300300
'u': r"(?P<u>[1-7])",
301301
'V': r"(?P<V>5[0-3]|0[1-9]|[1-4][0-9]|[0-9])",
302302
# W is set below by using 'U'
303-
'y': r"(?P<y>[0-9]{2})",
303+
'y': r"(?P<y>[0-9][0-9])",
304304
'Y': r"(?P<Y>[0-9]{4})",
305305
'z': r"(?P<z>[+-][0-9][0-9]:?[0-5][0-9](:?[0-5][0-9](\.[0-9]{1,6})?)?|(?-i:Z))",
306306
'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),

0 commit comments

Comments
 (0)