[issue31091] remove dead code in PyErr_GivenExceptionMatches()

2017-07-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is just a cleaning up. There is no bug in the old code. Usually such kind of changes are not backported. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31091] remove dead code in PyErr_GivenExceptionMatches()

2017-07-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e4c06bcca358c6dcb6393a75a1589ff6a2d45cde by Serhiy Storchaka (scoder) in branch 'master': bpo-31091: Remove dead code in PyErr_GivenExceptionMatches(). (#2963) https://github.com/python/cpython/commit/e4c06bcca358c6dcb6393a75a1589ff6a2d45cde -

[issue31091] remove dead code in PyErr_GivenExceptionMatches()

2017-07-31 Thread Stefan Behnel
Stefan Behnel added the comment: Looks like the switch from PyObject_IsSubclass() to PyType_IsSubtype() was made during the original Py3 development cycle. It should thus be safe to assume that the semantics are "as designed". :) What about applying the patch also to 3.6 and older? --

[issue31091] remove dead code in PyErr_GivenExceptionMatches()

2017-07-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pitrou, serhiy.storchaka stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list m

[issue31091] remove dead code in PyErr_GivenExceptionMatches()

2017-07-31 Thread Stefan Behnel
New submission from Stefan Behnel: PyObject *exception, *value, *tb; PyErr_Fetch(&exception, &value, &tb); /* PyObject_IsSubclass() can recurse and therefore is not safe (see test_bad_getattr in test.pickletester). */ res = PyType_IsSubtype((PyTypeObject *)err,