summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapi/exceptions.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror ↵Miss Islington (bot)2024-12-171-0/+1
| | | | | | | | | | messages (GH-126746) (GH-128023) - Add a helper to set an error from locale-encoded `char*` - Use the helper for gdbm & dlerror messages (cherry picked from commit 7303f06846b69016a075bca7ad7c6055f29ad024) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-108082: Add PyErr_FormatUnraisable() function (GH-111086)Serhiy Storchaka2023-10-311-0/+25
|
* gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455)Serhiy Storchaka2023-10-301-0/+17
| | | | Also document the behavior when called with NULL.
* gh-110964: Remove private _PyArg functions (#110966)Victor Stinner2023-10-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the following private functions and structures to pycore_modsupport.h internal C API: * _PyArg_BadArgument() * _PyArg_CheckPositional() * _PyArg_NoKeywords() * _PyArg_NoPositional() * _PyArg_ParseStack() * _PyArg_ParseStackAndKeywords() * _PyArg_Parser structure * _PyArg_UnpackKeywords() * _PyArg_UnpackKeywordsWithVararg() * _PyArg_UnpackStack() * _Py_ANY_VARARGS() Changes: * Python/getargs.h now includes pycore_modsupport.h to export functions. * clinic.py now adds pycore_modsupport.h when one of these functions is used. * Add pycore_modsupport.h includes when a C extension uses one of these functions. * Define Py_BUILD_CORE_MODULE in C extensions which now include directly or indirectly (via code generated by Argument Clinic) pycore_modsupport.h: * _csv * _curses_panel * _dbm * _gdbm * _multiprocessing.posixshmem * _sqlite.row * _statistics * grp * resource * syslog * _testcapi: bad_get() no longer uses METH_FASTCALL calling convention but METH_VARARGS. Replace _PyArg_UnpackStack() with PyArg_ParseTuple(). * _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined by _testcapi sub-modules which need the internal C API (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c, watchers.c. * Remove Include/cpython/modsupport.h header file. Include/modsupport.h no longer includes the removed header file. * Fix mypy clinic.py
* C API tests: use special markers to test that output parameters were set ↵Serhiy Storchaka2023-09-061-4/+7
| | | | (GH-109014)
* gh-106320: Remove private _PyErr_WriteUnraisableMsg() (#108863)Victor Stinner2023-09-041-31/+0
| | | | | | Move the private _PyErr_WriteUnraisableMsg() functions to the internal C API (pycore_pyerrors.h). Move write_unraisable_exc() from _testcapi to _testinternalcapi.
* Add Modules/_testcapi/util.h header (GH-108774)Serhiy Storchaka2023-09-011-1/+1
| | | It contains common macros used in C API tests.
* gh-107915: Handle errors in C API functions PyErr_Set*() and PyErr_Format() ↵Serhiy Storchaka2023-08-191-0/+41
| | | | | | | | (GH-107918) Such C API functions as PyErr_SetString(), PyErr_Format(), PyErr_SetFromErrnoWithFilename() and many others no longer crash or ignore errors if it failed to format the error message or decode the filename. Instead, they keep a corresponding error.
* gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* ↵Irit Katriel2023-05-301-0/+17
| | | | implementation in the unstable API (#105072)
* gh-104469: Convert _testcapi/exceptions to use AC (gh-104502)Dong-hee Na2023-05-211-97/+133
|
* gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover ↵Irit Katriel2023-03-211-3/+13
| | | | PyErr_Display as well (GH-102849)
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-10/+3
|
* gh-102594: PyErr_SetObject adds note to exception raised on normalization ↵Irit Katriel2023-03-161-0/+21
| | | | error (#102675)
* gh-102493: fix normalization in PyErr_SetObject (#102502)Irit Katriel2023-03-071-0/+15
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-93649: Split exception tests from _testcapimodule.c (GH-102173)Erlend E. Aasland2023-02-231-0/+277
Automerge-Triggered-By: GH:erlend-aasland