mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Removed two pointless and obfuscating macros.
This commit is contained in:
parent
cb7a6b5bf7
commit
d7c3652aa7
1 changed files with 4 additions and 7 deletions
|
@ -42,10 +42,7 @@ tb_dealloc(tracebackobject *tb)
|
||||||
Py_TRASHCAN_SAFE_END(tb)
|
Py_TRASHCAN_SAFE_END(tb)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define Tracebacktype PyTraceBack_Type
|
PyTypeObject PyTraceBack_Type = {
|
||||||
#define is_tracebackobject PyTraceBack_Check
|
|
||||||
|
|
||||||
PyTypeObject Tracebacktype = {
|
|
||||||
PyObject_HEAD_INIT(&PyType_Type)
|
PyObject_HEAD_INIT(&PyType_Type)
|
||||||
0,
|
0,
|
||||||
"traceback",
|
"traceback",
|
||||||
|
@ -67,12 +64,12 @@ newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti,
|
||||||
int lineno)
|
int lineno)
|
||||||
{
|
{
|
||||||
tracebackobject *tb;
|
tracebackobject *tb;
|
||||||
if ((next != NULL && !is_tracebackobject(next)) ||
|
if ((next != NULL && !PyTraceBack_Check(next)) ||
|
||||||
frame == NULL || !PyFrame_Check(frame)) {
|
frame == NULL || !PyFrame_Check(frame)) {
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
tb = PyObject_NEW(tracebackobject, &Tracebacktype);
|
tb = PyObject_NEW(tracebackobject, &PyTraceBack_Type);
|
||||||
if (tb != NULL) {
|
if (tb != NULL) {
|
||||||
Py_XINCREF(next);
|
Py_XINCREF(next);
|
||||||
tb->tb_next = next;
|
tb->tb_next = next;
|
||||||
|
@ -223,7 +220,7 @@ PyTraceBack_Print(PyObject *v, PyObject *f)
|
||||||
int limit = 1000;
|
int limit = 1000;
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
if (!is_tracebackobject(v)) {
|
if (!PyTraceBack_Check(v)) {
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue