[pypy-commit] pypy stdlib-2.7.12: more helpful failed repr/str messages expected by test_exceptions
pjenvey
pypy.commits at gmail.com
Sat Oct 8 21:49:46 EDT 2016
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: stdlib-2.7.12
Changeset: r87644:d46eaca6250c
Date: 2016-10-08 18:44 -0700
http://bitbucket.org/pypy/pypy/changeset/d46eaca6250c/
Log: more helpful failed repr/str messages expected by test_exceptions
diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -88,7 +88,8 @@
exc_value = space.str_w(space.str(w_value))
except OperationError:
# oups, cannot __str__ the exception object
- exc_value = "<oups, exception object itself cannot be str'd>"
+ exc_value = ("<exception %s() failed>" %
+ ("repr" if use_repr else "str"))
if not exc_value:
return exc_typename
else:
@@ -238,7 +239,7 @@
try:
objrepr = space.str_w(space.repr(w_object))
except OperationError:
- objrepr = '?'
+ objrepr = "<object repr() failed>"
#
try:
if with_traceback:
More information about the pypy-commit
mailing list