Message302873
Initially hasattr() suppressed all raised exceptions. In issue2196 hasattr() was changed to suppress only Exception exceptions and propagate exceptions like SystemExit and KeyboardInterrupt. In issue9666 hasattr() was changed to suppress only AttributeError.
But C API functions, PyObject_HasAttr() and like, were not changed. PyObject_HasAttr() is documented as an equivalent of hasattr(), but there is undocumented difference. The C code that uses PyObject_HasAttr() starves from the same problem as the Python code that used old hasattr().
The only solution of this problem is getting rid of PyObject_HasAttr() if favor of PyObject_GetAttr(). In this issue I'm going to propose a set of PRs that replace PyObject_HasAttr() invocations in different components with more correct code. |
|
Date |
User |
Action |
Args |
2017-09-24 17:46:45 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka |
2017-09-24 17:46:45 | serhiy.storchaka | set | messageid: <1506275205.91.0.662869765666.issue31572@psf.upfronthosting.co.za> |
2017-09-24 17:46:45 | serhiy.storchaka | link | issue31572 messages |
2017-09-24 17:46:45 | serhiy.storchaka | create | |
|