From a5e420a3aba44da3c1f33277a6ef6bee8521ae5a Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Sun, 28 Apr 2019 11:44:55 +0200 Subject: [PATCH] reprlib already handles both truncation and exceptions --- pysnooper/tracer.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index e0cb0aa..ea59552 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -13,18 +13,12 @@ except ImportError: from .third_party import six -MAX_VARIABLE_LENGTH = 100 ipython_filename_pattern = re.compile('^$') def get_shortish_repr(item): - try: - r = reprlib.repr(item) - except Exception: - r = 'REPR FAILED' + r = reprlib.repr(item) r = r.replace('\r', '').replace('\n', '') - if len(r) > MAX_VARIABLE_LENGTH: - r = '{truncated_r}...'.format(truncated_r=r[:MAX_VARIABLE_LENGTH]) return r