We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6753396 commit 7d7ff17Copy full SHA for 7d7ff17
c-ext/backend_c.c
@@ -313,7 +313,7 @@ size_t roundpow2(size_t i) {
313
int safe_pybytes_resize(PyObject **obj, Py_ssize_t size) {
314
PyObject *tmp;
315
316
- if ((*obj)->ob_refcnt == 1) {
+ if (Py_REFCNT(*obj) == 1) {
317
return _PyBytes_Resize(obj, size);
318
}
319
docs/news.rst
@@ -8,6 +8,8 @@ Version History
8
=========================
9
10
* PyO3 Rust created upgraded from 0.24 to 0.25. (#273)
11
+* We now use `Py_REFCNT(obj)` instead of accessing `(*obj)->ob_refcnt` directly.
12
+ This fixes a nogil / multi-threaded compile error. (#201, #275)
13
14
0.24.0 (released 2025-08-17)
15
============================
0 commit comments