From ddf0191ea43d763c784dcb5f7ab937d8ef1ae0b0 Mon Sep 17 00:00:00 2001 From: keremh Date: Fri, 24 Apr 2020 12:30:28 +0300 Subject: ENH: Fix exception causes in four .py files --- numpy/lib/index_tricks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/index_tricks.py') diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index b4118814d..538b32ea2 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -368,8 +368,8 @@ class AxisConcatenator: if len(vec) == 3: trans1d = int(vec[2]) continue - except Exception: - raise ValueError("unknown special directive") + except Exception as e: + raise ValueError("unknown special directive {!r}".format(item)) from e try: axis = int(item) continue -- cgit v1.2.1 From 8f12bfb00776ca35b6e445843d665a7d195d7f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerem=20Halla=C3=A7?= Date: Sat, 25 Apr 2020 22:16:42 +0300 Subject: Update numpy/lib/index_tricks.py Co-Authored-By: Ross Barnowski --- numpy/lib/index_tricks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/lib/index_tricks.py') diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 538b32ea2..d145477c3 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -369,7 +369,9 @@ class AxisConcatenator: trans1d = int(vec[2]) continue except Exception as e: - raise ValueError("unknown special directive {!r}".format(item)) from e + raise ValueError( + "unknown special directive {!r}".format(item) + ) from e try: axis = int(item) continue -- cgit v1.2.1