comparison Python/pythonrun.c @ 16845:09dcf5ebcd80 legacy-trunk

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.
author Fred Drake <fdrake@acm.org>
date Wed, 28 Feb 2001 20:58:04 +0000
parents 27f04d714ecb
children b0456d3a0f1f
comparison
equal deleted inserted replaced
16844:8156deb0e62d 16845:09dcf5ebcd80
1094 break; 1094 break;
1095 } 1095 }
1096 w = Py_BuildValue("(sO)", msg, v); 1096 w = Py_BuildValue("(sO)", msg, v);
1097 PyErr_SetObject(errtype, w); 1097 PyErr_SetObject(errtype, w);
1098 Py_XDECREF(w); 1098 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 }
1117 } 1099 }
1118 1100
1119 /* Print fatal error message and abort */ 1101 /* Print fatal error message and abort */
1120 1102
1121 void 1103 void