Skip to content

Commit edf4428

Browse files
committed
Remove _can_support_c99 from _pydatetime.py
1 parent 8231ace commit edf4428

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

Lib/_pydatetime.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,6 @@ def _need_normalize_century():
213213
_normalize_century = True
214214
return _normalize_century
215215

216-
_supports_c99 = None
217-
def _can_support_c99():
218-
global _supports_c99
219-
if _supports_c99 is None:
220-
try:
221-
_supports_c99 = (
222-
_time.strftime("%F", (1900, 1, 1, 0, 0, 0, 0, 1, 0)) == "1900-01-01")
223-
except ValueError:
224-
_supports_c99 = False
225-
return _supports_c99
226-
227216
# Correctly substitute for %z and %Z escapes in strftime formats.
228217
def _wrap_strftime(object, format, timetuple):
229218
# Don't call utcoffset() or tzname() unless actually needed.
@@ -283,7 +272,7 @@ def _wrap_strftime(object, format, timetuple):
283272
newformat.append(Zreplace)
284273
# Note that datetime(1000, 1, 1).strftime('%G') == '1000' so
285274
# year 1000 for %G can go on the fast path.
286-
elif ((ch in 'YG' or ch in 'FC' and _can_support_c99()) and
275+
elif ((ch in 'YG' or ch in 'FC') and
287276
object.year < 1000 and _need_normalize_century()):
288277
if ch == 'G':
289278
year = int(_time.strftime("%G", timetuple))

0 commit comments

Comments
 (0)