8000 gh-99181: fix except* on unhashable exceptions by iritkatriel · Pull Request #99192 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-99181: fix except* on unhashable exceptions #99192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename exc_key --> exc_id
  • Loading branch information
iritkatriel committed Nov 7, 2022
commit e725f63c5377321e2063b5e5f96bb1b68e85b5ee
16 changes: 8 additions & 8 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,12 @@ exceptiongroup_split_check_match(PyObject *exc,
case EXCEPTION_GROUP_MATCH_INSTANCE_IDS: {
assert(PySet_Check(matcher_value));
if (!_PyBaseExceptionGroup_Check(exc)) {
PyObject *exc_key = PyLong_FromVoidPtr(exc);
if (exc_key == NULL) {
PyObject *exc_id = PyLong_FromVoidPtr(exc);
if (exc_id == NULL) {
return -1;
}
int res = PySet_Contains(matcher_value, exc_key);
Py_DECREF(exc_key);
int res = PySet_Contains(matcher_value, exc_id);
Py_DECREF(exc_id);
return res;
}
return 0;
Expand Down Expand Up @@ -1230,12 +1230,12 @@ collect_exception_group_leaf_ids(PyObject *exc, PyObject *leaf_ids)
/* Add IDs of all leaf exceptions in exc to the leaf_ids set */

if (!_PyBaseExceptionGroup_Check(exc)) {
PyObject *exc_key = PyLong_FromVoidPtr(exc);
if (exc_key == NULL) {
PyObject *exc_id = PyLong_FromVoidPtr(exc);
if (exc_id == NULL) {
return -1;
}
int res = PySet_Add(leaf_ids, exc_key);
Py_DECREF(exc_key);
int res = PySet_Add(leaf_ids, exc_id);
Py_DECREF(exc_id);
return res;
}
PyBaseExceptionGroupObject *eg = _PyBaseExceptionGroupObject_cast(exc);
Expand Down
0