Skip to content

Commit a7443a1

Browse files
gh-52551: Use wcsftime() to implement time.strftime() on Windows (GH-125658)
1 parent 84074a4 commit a7443a1

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

Lib/test/test_strftime.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ class Y1900Tests(unittest.TestCase):
183183
def test_y_before_1900(self):
184184
# Issue #13674, #19634
185185
t = (1899, 1, 1, 0, 0, 0, 0, 0, 0)
186-
if (sys.platform == "win32"
187-
or sys.platform.startswith(("aix", "sunos", "solaris"))):
186+
if sys.platform.startswith(("aix", "sunos", "solaris")):
188187
with self.assertRaises(ValueError):
189188
time.strftime("%y", t)
190189
else:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.

Modules/timemodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,6 @@ checktm(struct tm* buf)
739739
return 1;
740740
}
741741

742-
#ifdef MS_WINDOWS
743-
/* wcsftime() doesn't format correctly time zones, see issue #10653 */
744-
# undef HAVE_WCSFTIME
745-
#endif
746742
#define STRFTIME_FORMAT_CODES \
747743
"Commonly used format codes:\n\
748744
\n\

0 commit comments

Comments
 (0)