diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1a2d2816..504c830e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,6 +62,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.14t" - "pypy-3.10" is_main: - ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} diff --git a/docs/project/changelog.rst b/docs/project/changelog.rst index 77bb181e..e4f9cb8a 100644 --- a/docs/project/changelog.rst +++ b/docs/project/changelog.rst @@ -45,6 +45,8 @@ New features * Validated compatibility with Python 3.14. +* Added support for free-threaded Python. + Improvements ............ diff --git a/src/websockets/speedups.c b/src/websockets/speedups.c index cb10dedb..f14ba3b9 100644 --- a/src/websockets/speedups.c +++ b/src/websockets/speedups.c @@ -218,5 +218,12 @@ static struct PyModuleDef speedups_module = { PyMODINIT_FUNC PyInit_speedups(void) { - return PyModule_Create(&speedups_module); + PyObject *m = PyModule_Create(&speedups_module); + if (m == NULL) { + return NULL; + } +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED); +#endif + return m; }