Introduced a regression for native descriptors.
PyFunction func_descr_get is fine with the change, it treats NULL and Py_None as equal:
But there are other tp_descr_get's which fast path on NULL and skip the type checking:
import wrapt
@wrapt.decorator
def passthrough(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)
wrapped = passthrough(str.upper)
# Simulate tp_descr_get call
wrapped.__get__(None, str) # TypeError on 2.2.0
I am working on a PR now to add the missing test coverage which would have caught this regression.
ae93dd7
Introduced a regression for native descriptors.
PyFunction func_descr_get is fine with the change, it treats NULL and Py_None as equal:
https://github.com/python/cpython/blob/cc48cfca7178c2131075b88b78592fed83a82a0c/Objects/funcobject.c#L1190-L1198
But there are other tp_descr_get's which fast path on NULL and skip the type checking:
descr_check is what is doing type checking against Py_None and failing for these cases.
Basic reproduction example:
Short term we should revert ae93dd7 and release 2.2.1.
I am working on a PR now to add the missing test coverage which would have caught this regression.