Skip to content

Commit f1cf169

Browse files
committed
Inline exec and wrap skipUnless args
1 parent a1caec9 commit f1cf169

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/test/test_struct.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,18 +800,18 @@ def test_c_complex_round_trip(self):
800800
round_trip = struct.unpack(f, struct.pack(f, z))[0]
801801
self.assertComplexesAreIdentical(z, round_trip)
802802

803-
@unittest.skipUnless(support.Py_GIL_DISABLED, 'this test can only possibly fail with GIL disabled')
803+
@unittest.skipUnless(
804+
support.Py_GIL_DISABLED,
805+
'this test can only possibly fail with GIL disabled'
806+
)
804807
def test_endian_table_init_subinterpreters(self):
805808
# Verify that the _struct extension module can be initialized
806809
# concurrently in subinterpreters (gh-140260).
807810
from concurrent.futures import InterpreterPoolExecutor
808811

809-
def _exec_code(code_str):
810-
exec(code_str)
811-
812812
code = "import struct"
813813
with InterpreterPoolExecutor(max_workers=5) as executor:
814-
results = executor.map(_exec_code, [code] * 5)
814+
results = executor.map(exec(code_str), [code] * 5)
815815
self.assertListEqual(list(results), [None] * 5)
816816

817817

0 commit comments

Comments
 (0)