summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorMitchell-Faas <35742861+Mitchell-Faas@users.noreply.github.com>2021-01-31 16:28:47 +0100
committerGitHub <noreply@github.com>2021-01-31 16:28:47 +0100
commitc47ddc18e490ae0b1a8422b2ce6e2b7b5781f87e (patch)
tree383f696a156a1ce9116df30f1c77ea598dca65a1 /numpy/core/arrayprint.py
parentda39ec1322f93732b7a80402e3a1f1d0ddcf3a7b (diff)
downloadnumpy-c47ddc18e490ae0b1a8422b2ce6e2b7b5781f87e.tar.gz
ENH: Improved error traceback in set_printoptions
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py4
1 files changed, 2 insertions, 2 deletions
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