BUG: fix np.resize refchk on python 3.14#30278
Conversation
f12027c to
2025931
Compare
|
Hmmmpf, this doesn't seem to work on older versions, I guess because the method call is passed a new reference (i.e. it was Oh well, if there is a simple solution great, if not... then too bad but OK, it's not the end of the world if this is just a best effort and I am not worried about the pattern in the issue, just thought there might be more. |
93d0bad to
b57caba
Compare
|
The fix ended up being to make the code python-version-dependent and avoid the definition in the compat header. The 2 references used to include a reference from the Python stack, but that's elided in 3.14, so there's only one reference. |
|
Thanks Nathan, makes sense that it changed in 3.14, seems to work so let's put it in! |
Use new API on Python 3.14 for unique reference check (as it changed and for free-threading). On older Python's there is an additional reference on the stack for the method call, though. Fixes numpygh-30265
Use new API on Python 3.14 for unique reference check (as it changed and for free-threading). On older Python's there is an additional reference on the stack for the method call, though. Fixes numpygh-30265
Fixes #30265