Remove any newlines from variables

This commit is contained in:
Ram Rachum 2019-04-24 15:30:51 +03:00
parent c0ae25deea
commit efc7dd0a97

View file

@ -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