Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix tests on python3.14t#166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromvstinner:free_threading
Feb 12, 2026
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletionstests/test_pythoncapi_compat.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,11 @@
except ImportError:
# Python 2
faulthandler = None
try:
import sysconfig
except ImportError:
# Python 3.1 and older
sysconfig = None

# test.utils
from utils import run_command, command_stdout
Expand DownExpand Up@@ -49,9 +54,7 @@ def display_title(title):
if not VERBOSE:
return

ver = sys.version_info
title = "Python %s.%s: %s" % (ver.major, ver.minor, title)

title = "%s: %s" % (python_version(), title)
print(title)
print("=" * len(title))
print()
Expand DownExpand Up@@ -94,10 +97,13 @@ def _run_tests(tests, verbose):
test_func()


_HAS_CLEAR_INTERNAL_CACHES = hasattr(sys, '_clear_internal_caches')
_HAS_CLEAR_TYPE_CACHE = hasattr(sys, '_clear_type_cache')

def _refleak_cleanup():
if _HAS_CLEAR_TYPE_CACHE:
if _HAS_CLEAR_INTERNAL_CACHES:
sys._clear_internal_caches()
elif _HAS_CLEAR_TYPE_CACHE:
sys._clear_type_cache()
gc.collect()

Expand DownExpand Up@@ -134,10 +140,18 @@ def python_version():
python_impl = "PyPy"
else:
python_impl = 'Python'
return "%s %s.%s (%s build)" % (python_impl, ver.major, ver.minor, build)
pyver = "%s.%s" % (ver.major, ver.minor)
if ver >= (3, 13):
if sysconfig.get_config_var('Py_GIL_DISABLED'):
# Free-threaded build
pyver += "t"
return "%s %s (%s build)" % (python_impl, pyver, build)


def run_tests(module_name, lang):
if VERBOSE:
print("")

title = "Test %s (%s)" % (module_name, lang)
display_title(title)

Expand Down
3 changes: 3 additions & 0 deletionstests/test_pythoncapi_compat_cext.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2624,6 +2624,9 @@ module_exec(PyObject *module)
#if PY_VERSION_HEX >= 0x03050000
static PyModuleDef_Slot module_slots[] = {
{Py_mod_exec, _Py_CAST(void*, module_exec)},
#if PY_VERSION_HEX >= 0x030D0000
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, _Py_NULL}
};
#endif
Expand Down
Loading

[8]ページ先頭

©2009-2026 Movatter.jp