Skip to content

Commit 13ce797

Browse files
Address Jelle's review
1 parent 7582e48 commit 13ce797

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎Modules/readline.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,9 @@ flex_complete(const char *text, int start, int end)
15131513
if (begidx == NULL || endidx == NULL) {
15141514
Py_XDECREF(begidx);
15151515
Py_XDECREF(endidx);
1516-
PyErr_Clear();
1516+
PyErr_FormatUnraisable("Exception ignored while preparing "
1517+
"readline completion");
1518+
rl_attempted_completion_over = 1;
15171519
PyGILState_Release(gilstate);
15181520
return NULL;
15191521
}

‎Python/ceval.c‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,11 @@ dtrace_function_entry(_PyInterpreterFrame *frame)
12291229
filename = PyUnicode_AsUTF8(code->co_filename);
12301230
funcname = PyUnicode_AsUTF8(code->co_name);
12311231
PyErr_SetRaisedException(exc);
1232-
if (filename == NULL || funcname == NULL) {
1233-
return;
1232+
if (filename == NULL) {
1233+
filename = "<unknown>";
1234+
}
1235+
if (funcname == NULL) {
1236+
funcname = "<unknown>";
12341237
}
12351238
lineno = PyUnstable_InterpreterFrame_GetLine(frame);
12361239

@@ -1249,8 +1252,11 @@ dtrace_function_return(_PyInterpreterFrame *frame)
12491252
filename = PyUnicode_AsUTF8(code->co_filename);
12501253
funcname = PyUnicode_AsUTF8(code->co_name);
12511254
PyErr_SetRaisedException(exc);
1252-
if (filename == NULL || funcname == NULL) {
1253-
return;
1255+
if (filename == NULL) {
1256+
filename = "<unknown>";
1257+
}
1258+
if (funcname == NULL) {
1259+
funcname = "<unknown>";
12541260
}
12551261
lineno = PyUnstable_InterpreterFrame_GetLine(frame);
12561262

0 commit comments

Comments
 (0)