py-tree-sitter icon indicating copy to clipboard operation
py-tree-sitter copied to clipboard

binding/query.c: use PyErr_Format instead of _PyErr_FormatFromCause

Open arthurzam opened this issue 1 year ago • 4 comments

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.

arthurzam avatar Aug 28 '24 17:08 arthurzam

PyErr_Format does not include the cause.

ObserverOfTime avatar Aug 28 '24 17:08 ObserverOfTime

PyErr_Format does not include the cause.

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

arthurzam avatar Aug 28 '24 17:08 arthurzam

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

ObserverOfTime avatar Aug 28 '24 17:08 ObserverOfTime

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

arthurzam avatar Aug 28 '24 17:08 arthurzam

Fixed in 2f7889d

ObserverOfTime avatar Aug 31 '24 06:08 ObserverOfTime

@ObserverOfTime any chance cutting a new release? Thanks!

chenrui333 avatar Oct 13 '24 13:10 chenrui333

It's in v0.23.1.

ObserverOfTime avatar Oct 13 '24 13:10 ObserverOfTime

sorry, I missed it, the 0.23.1 works for me, thanks!

chenrui333 avatar Oct 14 '24 00:10 chenrui333