get_real_func: use saferepr when formatting the error message

This commit is contained in:
Ronny Pfannschmidt 2017-01-19 13:05:58 +01:00
parent 123289a88e
commit 250597d468
1 changed files with 3 additions and 1 deletions

View File

@ -189,7 +189,9 @@ def get_real_func(obj):
else:
raise ValueError(
("could not find real function of {start}"
"\nstopped at {current}").format(start=start_obj, current=obj))
"\nstopped at {current}").format(
start=py.io.saferepr(start_obj),
current=py.io.saferepr(obj)))
if isinstance(obj, functools.partial):
obj = obj.func
return obj