Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c9d2ef commit 2658260Copy full SHA for 2658260
1 file changed
Python/pythonrun.c
@@ -1300,6 +1300,13 @@ print_exception(PyObject *f, PyObject *value)
1300
int err = 0;
1301
PyObject *type, *tb;
1302
1303
+ if (!PyExceptionInstance_Check(value)) {
1304
+ PyFile_WriteString("TypeError: print_exception(): Exception expected for value, ", f);
1305
+ PyFile_WriteString(Py_TYPE(value)->tp_name, f);
1306
+ PyFile_WriteString(" found\n", f);
1307
+ return;
1308
+ }
1309
+
1310
Py_INCREF(value);
1311
fflush(stdout);
1312
type = (PyObject *) Py_TYPE(value);
0 commit comments