This commit is contained in:
liblaf 2025-06-25 15:09:39 +08:00 committed by GitHub
commit 2da72b9a44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -610,6 +610,8 @@ def traverse(
else:
try:
obj_repr = repr(obj)
if max_string is not None and len(obj_repr) > max_string:
obj_repr = f"{obj_repr[:max_string]}..."
except Exception as error:
obj_repr = f"<repr-error {str(error)!r}>"
return obj_repr