Skip to content

Commit 250597d

Browse files
get_real_func: use saferepr when formatting the error message
1 parent 123289a commit 250597d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

_pytest/compat.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ def get_real_func(obj):
189189
else:
190190
raise ValueError(
191191
("could not find real function of {start}"
192-
"\nstopped at {current}").format(start=start_obj, current=obj))
192+
"\nstopped at {current}").format(
193+
start=py.io.saferepr(start_obj),
194+
current=py.io.saferepr(obj)))
193195
if isinstance(obj, functools.partial):
194196
obj = obj.func
195197
return obj

0 commit comments

Comments
 (0)