Skip to content

Commit 955c6f7

Browse files
committed
Address review: simplify the year-directive check and reword the NEWS entry
1 parent 677b8a5 commit 955c6f7

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/_pydatetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ def _wrap_strftime(object, format, timetuple):
272272
newformat.append(Zreplace)
273273
# Note that datetime(1000, 1, 1).strftime('%G') == '1000' so
274274
# year 1000 for %G can go on the fast path.
275-
elif ((ch in 'YG' or ch in 'FC') and
276-
timetuple[0] < 1000 and _need_normalize_century()):
275+
elif (ch in 'YGFC' and timetuple[0] < 1000 and
276+
_need_normalize_century()):
277277
if ch == 'G':
278278
year = int(_time.strftime("%G", timetuple))
279279
else:
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
Fix :meth:`datetime.time.strftime` raising :exc:`AttributeError` for the
2-
``%Y``, ``%G``, ``%C`` and ``%F`` directives in the pure-Python
3-
implementation. Patch by tonghuaroot.
1+
Fix the pure-Python :meth:`datetime.time.strftime` implementation raising :exc:`AttributeError` for the
2+
year directives. Patch by tonghuaroot.

0 commit comments

Comments
 (0)