diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-18 21:49:29 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-18 21:49:29 (GMT) |
commit | 53f098cdc6f1416e43090f518eac9a37cdcc818c (patch) | |
tree | f98fcf37fda9d4b82184a273f9c50fc1f0b45785 /Objects/frameobject.c | |
parent | 1637a68ab5649705809ac1fd844837f24dff4bcc (diff) | |
download | cpython-53f098cdc6f1416e43090f518eac9a37cdcc818c.zip cpython-53f098cdc6f1416e43090f518eac9a37cdcc818c.tar.gz cpython-53f098cdc6f1416e43090f518eac9a37cdcc818c.tar.bz2 |
Merged revisions 70463 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70463 | benjamin.peterson | 2009-03-18 15:52:15 -0500 (Wed, 18 Mar 2009) | 1 line
fix strange errors when setting attributes on tracebacks #4034
........
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 489e8bb..9a37b62 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -572,7 +572,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 * |