Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b797f1f

Browse files
committed
Now that Jeremy is asking about this code, it looks really bogus to me,
so let's rip it out. The constructor for SyntaxError does the right thing, so we do not need to do it again.
1 parent aece427 commit b797f1f

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

Python/pythonrun.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,24 +1096,6 @@ err_input(perrdetail *err)
10961096
w = Py_BuildValue("(sO)", msg, v);
10971097
PyErr_SetObject(errtype, w);
10981098
Py_XDECREF(w);
1099-
1100-
if (v != NULL) {
1101-
PyObject *exc, *tb;
1102-
1103-
PyErr_Fetch(&errtype, &exc, &tb);
1104-
PyErr_NormalizeException(&errtype, &exc, &tb);
1105-
if (PyObject_SetAttrString(exc, "filename",
1106-
PyTuple_GET_ITEM(v, 0)))
1107-
PyErr_Clear();
1108-
if (PyObject_SetAttrString(exc, "lineno",
1109-
PyTuple_GET_ITEM(v, 1)))
1110-
PyErr_Clear();
1111-
if (PyObject_SetAttrString(exc, "offset",
1112-
PyTuple_GET_ITEM(v, 2)))
1113-
PyErr_Clear();
1114-
Py_DECREF(v);
1115-
PyErr_Restore(errtype, exc, tb);
1116-
}
11171099
}
11181100

11191101
/* Print fatal error message and abort */

0 commit comments

Comments
 (0)