diff options
author | Scott Talbert <swt@techie.net> | 2022-11-30 23:49:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 23:49:39 -0500 |
commit | d753cb7d482387dac2369aed9fdf3f428e7382b1 (patch) | |
tree | e6cd9a2390da00ad17706955fcc09bb49bb3ddff | |
parent | 599df7329b0c8bc8606f04a1248460073957b078 (diff) | |
parent | dd8a824231a0081ddfee203f9f1764a39153fce3 (diff) | |
download | pycurl-d753cb7d482387dac2369aed9fdf3f428e7382b1.tar.gz |
Merge pull request #779 from swt2c/ci_python_311
Run CI for Python 3.11
-rw-r--r-- | .github/workflows/ci-macos.yml | 2 | ||||
-rw-r--r-- | .github/workflows/ci-windows.yml | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
-rw-r--r-- | src/easy.c | 4 | ||||
-rw-r--r-- | src/multi.c | 4 | ||||
-rw-r--r-- | src/pycurl.h | 8 | ||||
-rw-r--r-- | src/share.c | 4 | ||||
-rwxr-xr-x | tests/run.sh | 2 |
8 files changed, 18 insertions, 10 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 @@ -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); } 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 |