Explain why this is important
This commit is contained in:
parent
424479cf0f
commit
e7ed45a5d4
|
@ -327,6 +327,13 @@ def rewrite_asserts(mod):
|
|||
|
||||
|
||||
def _saferepr(obj):
|
||||
"""Get a safe repr of an object for assertion error messages
|
||||
|
||||
The assertion formatting (util.format_explanation()) requires
|
||||
newlines to be escaped since they are a special character for it.
|
||||
But py.io.saferepr allows newlines, so we need to escape them
|
||||
here.
|
||||
"""
|
||||
repr = py.io.saferepr(obj)
|
||||
if py.builtin._istext(repr):
|
||||
t = py.builtin.text
|
||||
|
|
Loading…
Reference in New Issue