From c47ddc18e490ae0b1a8422b2ce6e2b7b5781f87e Mon Sep 17 00:00:00 2001 From: Mitchell-Faas <35742861+Mitchell-Faas@users.noreply.github.com> Date: Sun, 31 Jan 2021 16:28:47 +0100 Subject: ENH: Improved error traceback in set_printoptions Co-authored-by: Eric Wieser --- numpy/core/arrayprint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/arrayprint.py') diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index ffcddd9b2..7c43d6f75 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -92,8 +92,8 @@ def _make_options_dict(precision=None, threshold=None, edgeitems=None, # forbid the bad precision arg as suggested by issue #18254 try: options['precision'] = index(precision) - except TypeError: - raise TypeError('precision must be an integer') + except TypeError as e: + raise TypeError('precision must be an integer') from e return options -- cgit v1.2.1