aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-01-06 12:47:28 +0100
committerGitHub <noreply@github.com>2021-01-06 12:47:28 +0100
commitfe9f446afe46bd716592eda9fa2af8d9f46bbce4 (patch)
tree60d215c0e59eeb8c54062e4486dc496fbabfc416 /Include
parentbpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602) (diff)
downloadcpython-fe9f446afe46bd716592eda9fa2af8d9f46bbce4.tar.gz
cpython-fe9f446afe46bd716592eda9fa2af8d9f46bbce4.tar.bz2
cpython-fe9f446afe46bd716592eda9fa2af8d9f46bbce4.zip
bpo-41798: Allocate _decimal extension module C API on the heap (GH-24117)
Diffstat (limited to 'Include')
-rw-r--r--Include/pydecimal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Include/pydecimal.h b/Include/pydecimal.h
index 9b6440e1c2a..f82e41f0aac 100644
--- a/Include/pydecimal.h
+++ b/Include/pydecimal.h
@@ -66,6 +66,8 @@ typedef struct {
/* Capsule API */
/****************************************************************************/
+#define PyDec_CAPSULE_NAME "_decimal._API"
+
/* Simple API */
#define PyDec_TypeCheck_INDEX 0
#define PyDec_TypeCheck_RETURN int
@@ -164,7 +166,7 @@ static void **_decimal_api;
static int
import_decimal(void)
{
- _decimal_api = (void **)PyCapsule_Import("_decimal._API", 0);
+ _decimal_api = (void **)PyCapsule_Import(PyDec_CAPSULE_NAME, 0);
if (_decimal_api == NULL) {
return -1;
}