From 7b495337bb762b59af103f08e94d2b3f01a7be36 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Wed, 19 Apr 2023 23:33:17 +0300 Subject: [PATCH] Started using [Limited API](https://docs.python.org/3/c-api/stable.html) in order to eliminate need of module recompilation. --- setup.py | 1 + src/ext.c | 1 + 2 files changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 6dd2914..5f42774 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ def get_version(): ext = Extension( 'pysetns.ext', sources=['src/ext.c'], + py_limited_api=True, ) setup( diff --git a/src/ext.c b/src/ext.c index dceb4f1..4425d95 100644 --- a/src/ext.c +++ b/src/ext.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#define Py_LIMITED_API 0x03080000f0 #include #include #include