summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-10-07 12:20:29 +0300
committerGitHub <noreply@github.com>2020-10-07 12:20:29 +0300
commit9e37e585cc86ff6dc821d0566baacc137cb16343 (patch)
treed95956726e68254c57eb485b56ad30649a0de2e4 /numpy/lib/format.py
parent3e52634d39f3a97815c6eb609209008ea5d69816 (diff)
parentfe01a9b1cca286f67e01807786b991dd22b1b7f7 (diff)
downloadnumpy-9e37e585cc86ff6dc821d0566baacc137cb16343.tar.gz
Merge pull request #17442 from devhpes/devhpes
MAINT: fix exception chaining in format.py
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index afbd3784a..5d951e262 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -746,7 +746,7 @@ def read_array(fp, allow_pickle=False, pickle_kwargs=None):
# Friendlier error message
raise UnicodeError("Unpickling a python object failed: %r\n"
"You may need to pass the encoding= option "
- "to numpy.load" % (err,))
+ "to numpy.load" % (err,)) from err
else:
if isfileobj(fp):
# We can use the fast fromfile() function.