2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 04:42:28 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Stefan Seefeld
8b7a8ccc85 Test multiple Python versions. 2025-03-18 16:00:49 -04:00
Aditya Pillai
3e7be69e1e Conditionally use Py_REFCNT 2025-03-10 15:10:12 -04:00
Aditya Pillai
cbdf1ce2a1 Use Py_REFCNT instead of ->ob_refcnt
Py_REFCNT was stabilized in 3.9, uses this official API instead of the
`ob_refcnt` field that doesn't exist in the free-threaded build of 3.13.
2025-03-10 15:10:12 -04:00
2 changed files with 8 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: [3.8.10] python-version: ['3.8.10', '3.12']
cxx: [clang++] cxx: [clang++]
std: [c++11, c++14] # TODO: c++17 is failing ! std: [c++11, c++14] # TODO: c++17 is failing !

View File

@@ -222,7 +222,13 @@ namespace
, char const* ref_type) , char const* ref_type)
{ {
handle<> holder(source); handle<> holder(source);
if (source->ob_refcnt <= 1) if (
#if PY_VERSION_HEX < 0x03090000
source->ob_refcnt
#else
Py_REFCNT(source)
#endif
<= 1)
{ {
handle<> msg( handle<> msg(
#if PY_VERSION_HEX >= 0x3000000 #if PY_VERSION_HEX >= 0x3000000