tree-sitter / py-tree-sitter

Python bindings to the Tree-sitter parsing library
https://tree-sitter.github.io/py-tree-sitter/
MIT License
817 stars 96 forks source link

binding/query.c: use PyErr_Format instead of _PyErr_FormatFromCause #284

Closed arthurzam closed 2 weeks ago

arthurzam commented 2 weeks ago

The _PyErr_FormatFromCause function is a private function, which was never documented. While it existed for a long time, it was removed in Python 3.13 https://github.com/python/cpython/issues/106320.

Use instead the public function PyErr_Format, which is also part of the stable API.

ObserverOfTime commented 2 weeks ago

PyErr_Format does not include the cause.

arthurzam commented 2 weeks ago

PyErr_Format does not include the cause.

OK, so which other function should we use? I can modify it as needed.

ObserverOfTime commented 2 weeks ago

It's complicated. I'll look into it during the weekend.

arthurzam commented 2 weeks ago

Thank you. I leave it to your discretion if you want to just close this PR, or override it, or anything else.

ObserverOfTime commented 2 weeks ago

Fixed in 2f7889d