Lines Matching defs:file
1410 thread_excepthook_file(PyObject *file, PyObject *exc_type, PyObject *exc_value,
1413 /* print(f"Exception in thread {thread.name}:", file=file) */
1414 if (PyFile_WriteString("Exception in thread ", file) < 0) {
1425 if (PyFile_WriteObject(name, file, Py_PRINT_RAW) < 0) {
1435 if (PyFile_WriteObject(str, file, Py_PRINT_RAW) < 0) {
1444 if (PyFile_WriteString("<failed to get thread name>", file) < 0) {
1450 if (PyFile_WriteString(":\n", file) < 0) {
1455 _PyErr_Display(file, exc_type, exc_value, exc_traceback);
1457 /* Call file.flush() */
1458 PyObject *res = PyObject_CallMethodNoArgs(file, &_Py_ID(flush));
1514 PyObject *file = _PySys_GetAttr(tstate, &_Py_ID(stderr));
1515 if (file == NULL || file == Py_None) {
1521 file = PyObject_GetAttrString(thread, "_stderr");
1522 if (file == NULL) {
1525 if (file == Py_None) {
1526 Py_DECREF(file);
1533 Py_INCREF(file);
1536 int res = thread_excepthook_file(file, exc_type, exc_value, exc_tb,
1538 Py_DECREF(file);