From 5787ba4a45492e232f5470c7d2e93763198e4b22 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 6 Apr 2021 20:55:13 +0800 Subject: [PATCH] bpo-41111: Don't build xxlimited with Py_TRACE_REFS macro (GH-25180) --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index edf3cb4f230b57..d0119362794906 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'])) + # 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'])) def detect_tkinter_fromenv(self): # Build _tkinter using the Tcl/Tk locations specified by