mirror of
https://github.com/python/cpython.git
synced 2025-09-16 13:47:31 +00:00
fix strange errors when setting attributes on tracebacks #4034
This commit is contained in:
parent
7c33bd5ecb
commit
6ffe852f90
4 changed files with 22 additions and 23 deletions
|
@ -604,7 +604,17 @@ static PyObject *builtin_object;
|
|||
int _PyFrame_Init()
|
||||
{
|
||||
builtin_object = PyString_InternFromString("__builtins__");
|
||||
return (builtin_object != NULL);
|
||||
if (builtin_object == NULL)
|
||||
return 0;
|
||||
/*
|
||||
Traceback objects are not created the normal way (through calling the
|
||||
type), so PyType_Ready has to be called here.
|
||||
*/
|
||||
if (PyType_Ready(&PyTraceBack_Type)) {
|
||||
Py_DECREF(builtin_object);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
PyFrameObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue