Commits

Daniel Roberts committed 74abc57

Formatted TypeError message to look like CPython.

Comments (0)

Files changed (1)

pypy/module/cpyext/sequence.py

 
-from pypy.interpreter.error import OperationError
+from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.module.cpyext.api import (
     cpython_api, CANNOT_FAIL, CONST_STRING, Py_ssize_t)
 from pypy.module.cpyext.pyobject import PyObject, borrow_from
     changes in your code for properly supporting 64-bit systems."""
 
     if PyDict_Check(space, w_o) or not PySequence_Check(space, w_o):
-        raise OperationError(space.w_TypeError, "object doesn't support sequence assignment") # FIXME: format like CPython
+        raise operationerrfmt(space.w_TypeError, "'%s' object does not support item assignment",
+                             space.str_w(space.repr(space.type(w_o)))) # FIXME: looks like lisp...
     space.setitem(w_o, space.wrap(i), w_v)
     return 0