Skip to content

Commit d48c46d

Browse files
committed
ensure define_macros exists before appending to it
1 parent 417336d commit d48c46d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cffi/setuptools_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _set_py_limited_api(Extension, kwds):
110110
log.info("Ignoring py_limited_api=True for free-threaded build.")
111111
kwds['py_limited_api'] = False
112112
else:
113-
kwds["define_macros"].append(("Py_TARGET_ABI3T", "0x030f0000"))
113+
kwds.setdefault("define_macros", []).append(("Py_TARGET_ABI3T", "0x030f0000"))
114114

115115
if kwds.get('py_limited_api') is False:
116116
# avoid setting Py_LIMITED_API if py_limited_api=False

0 commit comments

Comments
 (0)