Skip to content

Commit

Permalink
fix(query): handle errors in predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Nov 27, 2024
1 parent 1538ca1 commit 65b0c2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tree_sitter/binding/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ PyObject *query_captures(Query *self, PyObject *args, PyObject *kwargs) {
if (!query_satisfies_predicates(self, match, (Tree *)node->tree, predicate)) {
continue;
}
if (PyErr_Occurred()) {
return NULL;
}

TSQueryCapture capture = match.captures[capture_index];
PyObject *capture_name = PyList_GetItem(self->capture_names, capture.index);
Expand Down

0 comments on commit 65b0c2a

Please sign in to comment.