indygreg / python-zstandard

Python bindings to the Zstandard (zstd) compression library
BSD 3-Clause "New" or "Revised" License
481 stars 83 forks source link

use Py_REFCNT(obj) instead of obj->ob_refcnt (allows building in nogil) #201

Open jimkring opened 10 months ago

jimkring commented 10 months ago

here’s a suggestion from @colesbury:

This looks like it needs to use Py_REFCNT(obj) instead of obj->ob_refcnt. The reference count field changed (it's now two fields in "nogil Python), so you can't access them directly. The Python docs now say to use Py_REFCNT instead of ->ob_refcnt so maybe we can get this change upstreamed.