[pypy-commit] pypy default: In case of typo, the flow object space complained typically like that:

arigo noreply at buildbot.pypy.org
Sat Apr 28 11:27:49 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r54785:a91776704352
Date: 2012-04-28 10:38 +0200
http://bitbucket.org/pypy/pypy/changeset/a91776704352/

Log:	In case of typo, the flow object space complained typically like
	that:

	 found an operation that always raises AttributeError: generated
	by a constant operation: getattr

	That's very very uninformative. Display at least the arguments of
	the getattr operation.

diff --git a/pypy/objspace/flow/operation.py b/pypy/objspace/flow/operation.py
--- a/pypy/objspace/flow/operation.py
+++ b/pypy/objspace/flow/operation.py
@@ -350,8 +350,8 @@
                     result = op(*args)
                 except Exception, e:
                     etype = e.__class__
-                    msg = "generated by a constant operation:  %s" % (
-                        name)
+                    msg = "generated by a constant operation:\n\t%s%r" % (
+                        name, tuple(args))
                     raise OperationThatShouldNotBePropagatedError(
                         self.wrap(etype), self.wrap(msg))
                 else:


More information about the pypy-commit mailing list