mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Remove any newlines from variables
This commit is contained in:
parent
c0ae25deea
commit
efc7dd0a97
1 changed files with 1 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ def get_shortish_repr(item):
|
|||
r = repr(item)
|
||||
except Exception:
|
||||
r = 'REPR FAILED'
|
||||
r = r.replace('\r', '').replace('\n', '')
|
||||
if len(r) > MAX_VARIABLE_LENGTH:
|
||||
r = '{truncated_r}...'.format(truncated_r=r[:MAX_VARIABLE_LENGTH])
|
||||
return r
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue