CoolFace
Apppublic

vidya7732/AI_Doctor_LLM_GenModel

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes
pycore_traceback.h98 linesDownload Raw Back to internal
1#ifndef Py_INTERNAL_TRACEBACK_H2#define Py_INTERNAL_TRACEBACK_H3#ifdef __cplusplus4extern "C" {5#endif6 7#ifndef Py_BUILD_CORE8#  error "this header requires Py_BUILD_CORE define"9#endif10 11/* Forward declaration */12struct _is;13 14/* Write the Python traceback into the file 'fd'. For example:15 16       Traceback (most recent call first):17         File "xxx", line xxx in <xxx>18         File "xxx", line xxx in <xxx>19         ...20         File "xxx", line xxx in <xxx>21 22   This function is written for debug purpose only, to dump the traceback in23   the worst case: after a segmentation fault, at fatal error, etc. That's why,24   it is very limited. Strings are truncated to 100 characters and encoded to25   ASCII with backslashreplace. It doesn't write the source code, only the26   function name, filename and line number of each frame. Write only the first27   100 frames: if the traceback is truncated, write the line " ...".28 29   This function is signal safe. */30 31PyAPI_FUNC(void) _Py_DumpTraceback(32    int fd,33    PyThreadState *tstate);34 35/* Write the traceback of all threads into the file 'fd'. current_thread can be36   NULL.37 38   Return NULL on success, or an error message on error.39 40   This function is written for debug purpose only. It calls41   _Py_DumpTraceback() for each thread, and so has the same limitations. It42   only write the traceback of the first 100 threads: write "..." if there are43   more threads.44 45   If current_tstate is NULL, the function tries to get the Python thread state46   of the current thread. It is not an error if the function is unable to get47   the current Python thread state.48 49   If interp is NULL, the function tries to get the interpreter state from50   the current Python thread state, or from51   _PyGILState_GetInterpreterStateUnsafe() in last resort.52 53   It is better to pass NULL to interp and current_tstate, the function tries54   different options to retrieve these informations.55 56   This function is signal safe. */57 58PyAPI_FUNC(const char*) _Py_DumpTracebackThreads(59    int fd,60    struct _is *interp,61    PyThreadState *current_tstate);62 63/* Write a Unicode object into the file descriptor fd. Encode the string to64   ASCII using the backslashreplace error handler.65 66   Do nothing if text is not a Unicode object. The function accepts Unicode67   string which is not ready (PyUnicode_WCHAR_KIND).68 69   This function is signal safe. */70PyAPI_FUNC(void) _Py_DumpASCII(int fd, PyObject *text);71 72/* Format an integer as decimal into the file descriptor fd.73 74   This function is signal safe. */75PyAPI_FUNC(void) _Py_DumpDecimal(76    int fd,77    unsigned long value);78 79/* Format an integer as hexadecimal into the file descriptor fd with at least80   width digits.81 82   The maximum width is sizeof(unsigned long)*2 digits.83 84   This function is signal safe. */85PyAPI_FUNC(void) _Py_DumpHexadecimal(86    int fd,87    unsigned long value,88    Py_ssize_t width);89 90PyAPI_FUNC(PyObject*) _PyTraceBack_FromFrame(91    PyObject *tb_next,92    PyFrameObject *frame);93 94#ifdef __cplusplus95}96#endif97#endif /* !Py_INTERNAL_TRACEBACK_H */98