[pypy-commit] pypy py3k: improve the error message

antocuni noreply at buildbot.pypy.org
Wed Aug 22 18:52:21 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r56807:7a6f1ccdddd7
Date: 2012-08-22 17:15 +0200
http://bitbucket.org/pypy/pypy/changeset/7a6f1ccdddd7/

Log:	improve the error message

diff --git a/pypy/rlib/objectmodel.py b/pypy/rlib/objectmodel.py
--- a/pypy/rlib/objectmodel.py
+++ b/pypy/rlib/objectmodel.py
@@ -163,8 +163,8 @@
                 #
                 s_argtype = get_annotation(get_type_descr_of_argument(arg))
                 if not s_expected.contains(s_argtype):
-                    msg = "%s argument number %d must be of type %s" % (
-                        f.func_name, i+1, expected_type)
+                    msg = "%s argument %r must be of type %s" % (
+                        f.func_name, srcargs[i], expected_type)
                     raise TypeError, msg
         #
         # we cannot simply wrap the function using *args, **kwds, because it's


More information about the pypy-commit mailing list