summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-05-17 21:05:10 -0700
committerLarry Hastings <larry@hastings.org>2014-05-17 21:05:10 -0700
commit3a260d228b32b04a88d947b887bf81759e8e5f10 (patch)
treee4a34e9cbbf877cf021ffba743ddbf54e17526b7 /Objects
parent2110603344316d927e6d639275c12f5da78601d5 (diff)
parentb1a1ec3151155a1ae65831793b4a5b7a87d9d09f (diff)
downloadcpython-git-3a260d228b32b04a88d947b887bf81759e8e5f10.tar.gz
Merge.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 7f59d5da40..ba106a139a 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6919,9 +6919,16 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
if (type == NULL) {
/* Call super(), without args -- fill in from __class__
and first local variable on the stack. */
- PyFrameObject *f = PyThreadState_GET()->frame;
- PyCodeObject *co = f->f_code;
+ PyFrameObject *f;
+ PyCodeObject *co;
Py_ssize_t i, n;
+ f = PyThreadState_GET()->frame;
+ if (f == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "super(): no current frame");
+ return -1;
+ }
+ co = f->f_code;
if (co == NULL) {
PyErr_SetString(PyExc_RuntimeError,
"super(): no code object");