diff -r b36ce0a3a844 Lib/test/test_super.py --- a/Lib/test/test_super.py Tue Aug 21 11:39:47 2012 +0300 +++ b/Lib/test/test_super.py Thu Aug 23 19:57:45 2012 +0100 @@ -41,6 +41,10 @@ class G(A): pass +class H(A): + def f(*args): + return super().f() + 'H' + class TestSuper(unittest.TestCase): @@ -115,6 +119,10 @@ return __class__ self.assertIs(X.f(), X) + def test_variable_arguments(self): + # See issue 15753 + self.assertEqual(H().f(), 'AH') + def test_main(): support.run_unittest(TestSuper) diff -r b36ce0a3a844 Objects/typeobject.c --- a/Objects/typeobject.c Tue Aug 21 11:39:47 2012 +0300 +++ b/Objects/typeobject.c Thu Aug 23 19:57:45 2012 +0100 @@ -6501,17 +6501,26 @@ "super(): no code object"); return -1; } - if (co->co_argcount == 0) { - PyErr_SetString(PyExc_SystemError, + if (co->co_argcount == 0 && !(co->co_flags & CO_VARARGS)) { + PyErr_SetString(PyExc_RuntimeError, "super(): no arguments"); return -1; } obj = f->f_localsplus[0]; if (obj == NULL) { - PyErr_SetString(PyExc_SystemError, + PyErr_SetString(PyExc_RuntimeError, "super(): arg[0] deleted"); return -1; } + if (co->co_argcount == 0 && co->co_flags & CO_VARARGS) { + assert(PyTuple_Check(obj)); + if (PyTuple_GET_SIZE(obj) == 0) { + PyErr_SetString(PyExc_RuntimeError, + "super(): no arguments"); + return -1; + } + obj = PyTuple_GetItem(obj, 0); + } if (co->co_freevars == NULL) n = 0; else { @@ -6538,7 +6547,7 @@ return -1; } if (!PyType_Check(type)) { - PyErr_Format(PyExc_SystemError, + PyErr_Format(PyExc_RuntimeError, "super(): __class__ is not a type (%s)", Py_TYPE(type)->tp_name); return -1; @@ -6547,7 +6556,7 @@ } } if (type == NULL) { - PyErr_SetString(PyExc_SystemError, + PyErr_SetString(PyExc_RuntimeError, "super(): __class__ cell not found"); return -1; }