mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Merge 18465d36ee
into 9c9b011187
This commit is contained in:
commit
2da72b9a44
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue