-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packaging/rpm/patches/03ae30013de3fde03719c9b1c9c53b39c389b599.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 03ae30013de3fde03719c9b1c9c53b39c389b599 Mon Sep 17 00:00:00 2001 | ||
From: Daniele Nicolodi <daniele@grinta.net> | ||
Date: Mon, 27 Mar 2023 21:41:56 +0200 | ||
Subject: [PATCH] Fix compilation with CPython 3.12a6 | ||
|
||
CPython 3.12a6 made PyThreadState an opaque structure thus the fast | ||
thread state optimization cannot be employed anymore. | ||
|
||
Fixes #5286. | ||
--- | ||
Cython/Utility/ModuleSetupCode.c | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c | ||
index e461cda1e7..950d89a679 100644 | ||
--- a/Cython/Utility/ModuleSetupCode.c | ||
+++ b/Cython/Utility/ModuleSetupCode.c | ||
@@ -331,7 +331,8 @@ | ||
#define CYTHON_UNPACK_METHODS 1 | ||
#endif | ||
#ifndef CYTHON_FAST_THREAD_STATE | ||
- #define CYTHON_FAST_THREAD_STATE 1 | ||
+ // CPython 3.12a6 made PyThreadState an opaque struct. | ||
+ #define CYTHON_FAST_THREAD_STATE (PY_VERSION_HEX < 0x030C00A6) | ||
#endif | ||
#ifndef CYTHON_FAST_GIL | ||
// Py3<3.5.2 does not support _PyThreadState_UncheckedGet(). |