Skip to content

Commit dde0f39

Browse files
committed
fix windows errors?
1 parent 7d45424 commit dde0f39

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ def test_sys_flags(self):
871871
self.assertIn(sys.flags.utf8_mode, {0, 1, 2})
872872

873873
# non-tuple sequence fields
874-
self.assertIsInstance(sys.flags.gil, int)
874+
self.assertIsInstance(sys.flags.gil, int|type(None))
875875
self.assertIsInstance(sys.flags.traceback_timestamps, str)
876876

877877

Lib/test/test_traceback_timestamps.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,15 @@ def test_strip_exc_timestamps_function(self):
214214
for mode in ("us", "ns", "iso"):
215215
with self.subTest(mode):
216216
result = script_helper.assert_python_failure(
217-
"-X", f"traceback_timestamps={mode}", self.script_strip_path
217+
"-X", f"traceback_timestamps={mode}",
218+
"-X", "utf8=1", self.script_strip_path
218219
)
219220
output = result.out.decode() + result.err.decode()
220221

221222
# call strip_exc_timestamps in a process using the same mode as what generated our output.
222223
result = script_helper.assert_python_ok(
223-
"-X", f"traceback_timestamps={mode}", self.script_strip_path, output
224+
"-X", f"traceback_timestamps={mode}",
225+
"-X", "utf8=1", self.script_strip_path, output
224226
)
225227
stripped_output = result.out.decode() + result.err.decode()
226228

@@ -234,13 +236,15 @@ def test_strip_exc_timestamps_with_disabled_timestamps(self):
234236
"""Test the strip_exc_timestamps function when timestamps are disabled"""
235237
# Run with timestamps disabled
236238
result = script_helper.assert_python_failure(
237-
"-X", "traceback_timestamps=0", self.script_strip_path
239+
"-X", "traceback_timestamps=0",
240+
"-X", "utf8=1", self.script_strip_path
238241
)
239242
output = result.out.decode() + result.err.decode()
240243

241244
# call strip_exc_timestamps in a process using the same mode as what generated our output.
242245
result = script_helper.assert_python_ok(
243-
"-X", "traceback_timestamps=0", self.script_strip_path, output
246+
"-X", "traceback_timestamps=0",
247+
"-X", "utf8=1", self.script_strip_path, output
244248
)
245249
stripped_output = result.out.decode() + result.err.decode()
246250

0 commit comments

Comments
 (0)