From 653b3f4df0625ec6893bb0c40bdbc38b684628b0 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Wed, 30 Nov 2022 22:47:17 -0500 Subject: Run CI for Python 3.11 --- .github/workflows/ci-macos.yml | 2 +- .github/workflows/ci-windows.yml | 2 +- .github/workflows/ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 4a09619..0474e25 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 362b967..865138a 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -14,7 +14,7 @@ jobs: VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] fail-fast: false permissions: packages: write diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9973d58..212c99b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 -- cgit v1.2.1 From 16a1a23db2ab5353224d4050b9b558a3f5d7f703 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Wed, 30 Nov 2022 23:19:09 -0500 Subject: Remove use of deprecated Py_TRASHCAN_SAFE_BEGIN / Py_TRASHCAN_SAFE_END Replace it with Py_TRASHCAN_BEGIN / Py_TRASHCAN_END on Python 3.8+. --- src/easy.c | 4 ++-- src/multi.c | 4 ++-- src/pycurl.h | 8 ++++++++ src/share.c | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/easy.c b/src/easy.c index 4fe6cee..1b3464a 100644 --- a/src/easy.c +++ b/src/easy.c @@ -606,13 +606,13 @@ PYCURL_INTERNAL void do_curl_dealloc(CurlObject *self) { PyObject_GC_UnTrack(self); - Py_TRASHCAN_SAFE_BEGIN(self); + CPy_TRASHCAN_BEGIN(self, do_curl_dealloc); Py_CLEAR(self->dict); util_curl_close(self); Curl_Type.tp_free(self); - Py_TRASHCAN_SAFE_END(self); + CPy_TRASHCAN_END(self); } diff --git a/src/multi.c b/src/multi.c index ebe129f..3dbc3fc 100644 --- a/src/multi.c +++ b/src/multi.c @@ -117,7 +117,7 @@ PYCURL_INTERNAL void do_multi_dealloc(CurlMultiObject *self) { PyObject_GC_UnTrack(self); - Py_TRASHCAN_SAFE_BEGIN(self); + CPy_TRASHCAN_BEGIN(self, do_multi_dealloc); util_multi_xdecref(self); util_multi_close(self); @@ -127,7 +127,7 @@ do_multi_dealloc(CurlMultiObject *self) } CurlMulti_Type.tp_free(self); - Py_TRASHCAN_SAFE_END(self); + CPy_TRASHCAN_END(self); } diff --git a/src/pycurl.h b/src/pycurl.h index 6f70a9a..9a97f0b 100644 --- a/src/pycurl.h +++ b/src/pycurl.h @@ -693,5 +693,13 @@ extern PyMethodDef curlmultiobject_methods[]; # define PYCURL_TYPE_FLAGS Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_WEAKREFS | Py_TPFLAGS_BASETYPE #endif +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 8 +# define CPy_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_BEGIN(op, dealloc) +# define CPy_TRASHCAN_END(op) Py_TRASHCAN_END +#else +# define CPy_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_SAFE_BEGIN(op) +# define CPy_TRASHCAN_END(op) Py_TRASHCAN_SAFE_END(op) +#endif + /* vi:ts=4:et:nowrap */ diff --git a/src/share.c b/src/share.c index 27e49ac..94b25b4 100644 --- a/src/share.c +++ b/src/share.c @@ -119,7 +119,7 @@ PYCURL_INTERNAL void do_share_dealloc(CurlShareObject *self) { PyObject_GC_UnTrack(self); - Py_TRASHCAN_SAFE_BEGIN(self); + CPy_TRASHCAN_BEGIN(self, do_share_dealloc); Py_CLEAR(self->dict); util_share_close(self); @@ -133,7 +133,7 @@ do_share_dealloc(CurlShareObject *self) } CurlShare_Type.tp_free(self); - Py_TRASHCAN_SAFE_END(self); + CPy_TRASHCAN_END(self); } -- cgit v1.2.1 From dd8a824231a0081ddfee203f9f1764a39153fce3 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Wed, 30 Nov 2022 23:20:33 -0500 Subject: Run tests verbosely --- tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run.sh b/tests/run.sh index 52b5227..48c29c3 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -26,4 +26,4 @@ if test "$CI" = true; then fi $PYTHON -c 'import pycurl; print(pycurl.version)' -$PYTEST +$PYTEST -v -- cgit v1.2.1