Call correct _saferepr() in _format_assertmsg

Fixes: #6682
This commit is contained in:
Sorin Sbarnea 2024-05-14 10:14:36 +01:00
parent 93dd34e76d
commit 66a18f7199
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -451,7 +451,7 @@ def _format_assertmsg(obj: object) -> str:
# However in either case we want to preserve the newline.
replaces = [("\n", "\n~"), ("%", "%%")]
if not isinstance(obj, str):
obj = saferepr(obj)
obj = _saferepr(obj)
replaces.append(("\\n", "\n~"))
for r1, r2 in replaces: