summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Talbert <swt@techie.net>2022-11-30 23:49:39 -0500
committerGitHub <noreply@github.com>2022-11-30 23:49:39 -0500
commitd753cb7d482387dac2369aed9fdf3f428e7382b1 (patch)
treee6cd9a2390da00ad17706955fcc09bb49bb3ddff
parent599df7329b0c8bc8606f04a1248460073957b078 (diff)
parentdd8a824231a0081ddfee203f9f1764a39153fce3 (diff)
downloadpycurl-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.yml2
-rw-r--r--.github/workflows/ci-windows.yml2
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--src/easy.c4
-rw-r--r--src/multi.c4
-rw-r--r--src/pycurl.h8
-rw-r--r--src/share.c4
-rwxr-xr-xtests/run.sh2
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
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);
}
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