summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2023-12-13 15:38:45 (GMT)
committerGitHub <noreply@github.com>2023-12-13 15:38:45 (GMT)
commit79dad03747fe17634136209f1bcaf346a8c10617 (patch)
tree0ca624c64faee7dba75917b1483ab9318c2676f5 /PC
parent498a096a51a215cd3084845131e619222b906b3e (diff)
downloadcpython-79dad03747fe17634136209f1bcaf346a8c10617.zip
cpython-79dad03747fe17634136209f1bcaf346a8c10617.tar.gz
cpython-79dad03747fe17634136209f1bcaf346a8c10617.tar.bz2
gh-111650: Ensure pyconfig.h includes Py_GIL_DISABLED on Windows (GH-112778)
Diffstat (limited to 'PC')
-rw-r--r--PC/layout/main.py8
-rw-r--r--PC/pyconfig.h.in (renamed from PC/pyconfig.h)3
-rw-r--r--PC/winsound.c2
3 files changed, 10 insertions, 3 deletions
diff --git a/PC/layout/main.py b/PC/layout/main.py
index cb2e487..accfd51 100644
--- a/PC/layout/main.py
+++ b/PC/layout/main.py
@@ -73,7 +73,10 @@ def copy_if_modified(src, dest):
)
if do_copy:
- shutil.copy2(src, dest)
+ try:
+ shutil.copy2(src, dest)
+ except FileNotFoundError:
+ raise FileNotFoundError(src) from None
def get_lib_layout(ns):
@@ -208,8 +211,7 @@ def get_layout(ns):
for dest, src in rglob(ns.source / "Include", "**/*.h"):
yield "include/{}".format(dest), src
- src = ns.source / "PC" / "pyconfig.h"
- yield "include/pyconfig.h", src
+ yield "include/pyconfig.h", ns.build / "pyconfig.h"
for dest, src in get_tcltk_lib(ns):
yield dest, src
diff --git a/PC/pyconfig.h b/PC/pyconfig.h.in
index e6b368c..d8f0a6b 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h.in
@@ -739,4 +739,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* Define if libssl has X509_VERIFY_PARAM_set1_host and related function */
#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1
+/* Define if you want to disable the GIL */
+#undef Py_GIL_DISABLED
+
#endif /* !Py_CONFIG_H */
diff --git a/PC/winsound.c b/PC/winsound.c
index b0e416c..7e4ebd9 100644
--- a/PC/winsound.c
+++ b/PC/winsound.c
@@ -35,6 +35,8 @@
winsound.PlaySound(None, 0)
*/
+#include "pyconfig.h" // Py_GIL_DISABLED
+
#ifndef Py_GIL_DISABLED
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
#define Py_LIMITED_API 0x030c0000