Index: Lib/test/test_extcall.py =================================================================== --- Lib/test/test_extcall.py (revision 69514) +++ Lib/test/test_extcall.py (working copy) @@ -92,7 +92,7 @@ >>> g(*Nothing()) Traceback (most recent call last): ... - TypeError: g() argument after * must be a sequence, not instance + TypeError: iteration over non-sequence >>> class Nothing: ... def __len__(self): return 5 @@ -101,7 +101,7 @@ >>> g(*Nothing()) Traceback (most recent call last): ... - TypeError: g() argument after * must be a sequence, not instance + TypeError: iteration over non-sequence >>> class Nothing(): ... def __len__(self): return 5 @@ -166,18 +166,17 @@ >>> h(*h) Traceback (most recent call last): ... - TypeError: h() argument after * must be a sequence, not function + TypeError: 'function' object is not iterable >>> dir(*h) Traceback (most recent call last): ... - TypeError: dir() argument after * must be a sequence, not function + TypeError: 'function' object is not iterable >>> None(*h) Traceback (most recent call last): ... - TypeError: NoneType object argument after * must be a sequence, \ -not function + TypeError: 'function' object is not iterable >>> h(**h) Traceback (most recent call last): Index: Python/ceval.c =================================================================== --- Python/ceval.c (revision 69514) +++ Python/ceval.c (working copy) @@ -4118,7 +4118,9 @@ PyObject *t = NULL; t = PySequence_Tuple(stararg); if (t == NULL) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) { + if (PyErr_ExceptionMatches(PyExc_TypeError) && + (!PyType_HasFeature(Py_TYPE(stararg), + Py_TPFLAGS_HAVE_ITER))) { PyErr_Format(PyExc_TypeError, "%.200s%.200s argument after * " "must be a sequence, not %200s",