From 6cbaff5e6fe4ef4fad965248c96871aad53af0eb Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sun, 4 Apr 2021 16:27:59 +0800 Subject: [PATCH 1/2] Build limited C API without Py_TRACE_REFS macro. --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index edf3cb4f230b57..2e9b2bb3eb9411 100644 --- a/setup.py +++ b/setup.py @@ -1864,9 +1864,10 @@ def detect_modules(self): ## # Uncomment these lines if you want to play with xxmodule.c ## self.add(Extension('xx', ['xxmodule.c'])) - # Limited C API - self.add(Extension('xxlimited', ['xxlimited.c'])) - self.add(Extension('xxlimited_35', ['xxlimited_35.c'])) + # Build limited C API without Py_TRACE_REFS macro + if not sysconfig.get_config_var('Py_TRACE_REFS'): + self.add(Extension('xxlimited', ['xxlimited.c'])) + self.add(Extension('xxlimited_35', ['xxlimited_35.c'])) def detect_tkinter_fromenv(self): # Build _tkinter using the Tcl/Tk locations specified by From dc080bd8341c9fb0552d947bb4f798ce001f4f26 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sun, 4 Apr 2021 22:29:51 +0800 Subject: [PATCH 2/2] apply victor's comment --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2e9b2bb3eb9411..d0119362794906 100644 --- a/setup.py +++ b/setup.py @@ -1864,7 +1864,7 @@ def detect_modules(self): ## # Uncomment these lines if you want to play with xxmodule.c ## self.add(Extension('xx', ['xxmodule.c'])) - # Build limited C API without Py_TRACE_REFS macro + # The limited C API is not compatible with the Py_TRACE_REFS macro. if not sysconfig.get_config_var('Py_TRACE_REFS'): self.add(Extension('xxlimited', ['xxlimited.c'])) self.add(Extension('xxlimited_35', ['xxlimited_35.c']))