diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-18 20:52:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-18 20:52:15 (GMT) |
commit | 6ffe852f903490132bf33acbb91ee4d2d2ef06b8 (patch) | |
tree | 456df27bfc4fa59f1ed1523a8a58e31f0592ff39 /Objects | |
parent | 7c33bd5ecba73625a3e48685a62870dd6a9806f1 (diff) | |
download | cpython-6ffe852f903490132bf33acbb91ee4d2d2ef06b8.zip cpython-6ffe852f903490132bf33acbb91ee4d2d2ef06b8.tar.gz cpython-6ffe852f903490132bf33acbb91ee4d2d2ef06b8.tar.bz2 |
fix strange errors when setting attributes on tracebacks #4034
Diffstat (limited to 'Objects')
-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 1ea586f..c8cf71b 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -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 * |