Skip to content

Commit 237f097

Browse files
tests/: fix tests if we are incorrectly claiming to be thread safe.
1 parent cd89bb0 commit 237f097

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_4767.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_stdout(cp):
7272
Strips free-threading warning.
7373
'''
7474
stdout = cp.stdout
75-
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1:
75+
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1 and sys._is_gil_enabled():
7676
line0, stdout = stdout.split('\n', 1)
7777
assert 'The global interpreter lock (GIL) has been enabled to load module \'pymupdf._extra\',' in line0
7878
return stdout

tests/test_general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,11 +2031,11 @@ def test_4392():
20312031

20322032
assert e1 == 5
20332033
if pymupdf.swig_version_tuple >= (4, 4):
2034-
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1:
2034+
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1 and sys._is_gil_enabled():
20352035
assert e2 == 4
20362036
else:
20372037
assert e2 == 5
2038-
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1:
2038+
if sysconfig.get_config_var('Py_GIL_DISABLED') == 1 and sys._is_gil_enabled():
20392039
# GIL warning results in failure because of -Werror.
20402040
assert e3 == 1
20412041
else:

0 commit comments

Comments
 (0)