mirror of
https://github.com/python/cpython.git
synced 2025-09-02 23:18:25 +00:00
[3.11] gh-75367: Fix data descriptor detection in inspect.getattr_static (GH-104517) (#104557)
gh-75367: Fix data descriptor detection in inspect.getattr_static (GH-104517)
(cherry picked from commit 5e9f471e7d
)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
parent
9cac6c414f
commit
f748fc9f44
3 changed files with 8 additions and 2 deletions
|
@ -1829,8 +1829,10 @@ def getattr_static(obj, attr, default=_sentinel):
|
|||
klass_result = _check_class(klass, attr)
|
||||
|
||||
if instance_result is not _sentinel and klass_result is not _sentinel:
|
||||
if (_check_class(type(klass_result), '__get__') is not _sentinel and
|
||||
_check_class(type(klass_result), '__set__') is not _sentinel):
|
||||
if _check_class(type(klass_result), "__get__") is not _sentinel and (
|
||||
_check_class(type(klass_result), "__set__") is not _sentinel
|
||||
or _check_class(type(klass_result), "__delete__") is not _sentinel
|
||||
):
|
||||
return klass_result
|
||||
|
||||
if instance_result is not _sentinel:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue