]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-136315: Fix skipped multithreading test in test_zstd (GH-136320) (#136322)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 5 Jul 2025 18:24:19 +0000 (20:24 +0200)
committerGitHub <noreply@github.com>
Sat, 5 Jul 2025 18:24:19 +0000 (11:24 -0700)
gh-136315: Fix skipped multithreading test in test_zstd (GH-136320)

Fix skipped test in test_zstd
(cherry picked from commit 5dac137b9f75c5c1d5096101bcd33d565d0526e4)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Lib/test/test_zstd.py

index 7bd0ffd9391529d2e045ebebfec5b18d376330c8..e83caaf4c07b13d95f4817537c82a2e03c3cf007 100644 (file)
@@ -63,15 +63,18 @@ SAMPLES = None
 
 TRAINED_DICT = None
 
-SUPPORT_MULTITHREADING = False
+# Cannot be deferred to setup as it is used to check whether or not to skip
+# tests
+try:
+    SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
+except Exception:
+    SUPPORT_MULTITHREADING = False
 
 C_INT_MIN = -(2**31)
 C_INT_MAX = (2**31) - 1
 
 
 def setUpModule():
-    global SUPPORT_MULTITHREADING
-    SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
     # uncompressed size 130KB, more than a zstd block.
     # with a frame epilogue, 4 bytes checksum.
     global DAT_130K_D