From cb71c43d45c0ad6e14db97a51e317b771f6a9ebb Mon Sep 17 00:00:00 2001 From: Abhay Raghuvanshi Date: Fri, 19 Mar 2021 04:45:07 +0530 Subject: MAINT: Added Chain exceptions where appropriate (#18400) * Added chain exception in _pocketfft.py * Added chain exception in format.py * Added chain exception in make_lite.py * Added chain exception in mrecords.py * added from e for exceptions * Minor update for _read_array_header exception msg * Removed \n from excp msg and e from msg format. Co-authored-by: Eric Wieser * Update numpy/linalg/lapack_lite/make_lite.py Co-authored-by: Eric Wieser Co-authored-by: Eric Wieser Co-authored-by: Charles Harris --- numpy/lib/format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index ac5f75fba..904c32cc7 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -594,8 +594,8 @@ def _read_array_header(fp, version): try: d = safe_eval(header) except SyntaxError as e: - msg = "Cannot parse header: {!r}\nException: {!r}" - raise ValueError(msg.format(header, e)) from None + msg = "Cannot parse header: {!r}" + raise ValueError(msg.format(header)) from e if not isinstance(d, dict): msg = "Header is not a dictionary: {!r}" raise ValueError(msg.format(d)) -- cgit v1.2.1