bpo-46417: Factorize _PyExc_InitTypes() code (GH-30804) · python/cpython@f1bcdea · GitHub
Skip to content

Commit f1bcdea

Browse files
authored
bpo-46417: Factorize _PyExc_InitTypes() code (GH-30804)
Add 'static_exceptions' list to factorize code between _PyExc_InitTypes() and _PyBuiltins_AddExceptions(). _PyExc_InitTypes() does nothing if it's not the main interpreter. Sort exceptions in Lib/test/exception_hierarchy.txt.
1 parent a941e59 commit f1bcdea

5 files changed

Lines changed: 150 additions & 190 deletions

File tree

Include/internal/pycore_exceptions.h

Lines changed: 1 addition & 1 deletion

Include/internal/pycore_pylifecycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options);
5959
extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config);
6060
extern int _PySys_UpdateConfig(PyThreadState *tstate);
6161
extern void _PySys_Fini(PyInterpreterState *interp);
62-
extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod);
62+
extern int _PyBuiltins_AddExceptions(PyObject * bltinmod);
6363
extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
6464

6565
extern PyStatus _PyImportZip_Init(PyThreadState *tstate);

Lib/test/exception_hierarchy.txt

Lines changed: 12 additions & 12 deletions

0 commit comments

Comments
 (0)