pycore_exceptions.h 842 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef Py_INTERNAL_EXCEPTIONS_H
  2. #define Py_INTERNAL_EXCEPTIONS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef Py_BUILD_CORE
  7. # error "this header requires Py_BUILD_CORE define"
  8. #endif
  9. /* runtime lifecycle */
  10. extern PyStatus _PyExc_InitState(PyInterpreterState *);
  11. extern PyStatus _PyExc_InitGlobalObjects(PyInterpreterState *);
  12. extern int _PyExc_InitTypes(PyInterpreterState *);
  13. extern void _PyExc_Fini(PyInterpreterState *);
  14. /* other API */
  15. struct _Py_exc_state {
  16. // The dict mapping from errno codes to OSError subclasses
  17. PyObject *errnomap;
  18. PyBaseExceptionObject *memerrors_freelist;
  19. int memerrors_numfree;
  20. // The ExceptionGroup type
  21. PyObject *PyExc_ExceptionGroup;
  22. };
  23. extern void _PyExc_ClearExceptionGroupType(PyInterpreterState *);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif /* !Py_INTERNAL_EXCEPTIONS_H */