gh-76763: chr function raises ValueError exception instead OverflowError by furkanonder · Pull Request #104486 · python/cpython
Conversation
|
|
||
| i = _PyLong_AsInt(arg); | ||
| if (i == -1 && PyErr_Occurred()) { | ||
| if (PyErr_ExceptionMatches(PyExc_OverflowError)) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't change the generated Argument Clinic files directly. I'm not sure, unfortunately, if there's an easy way to implement the desired behavior while still using Argument Clinic.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an implementation detail. On platform with INT_MAX >= 2**32 it raises ValueError.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters