From 7949ba5ec0543d3b1fd68e95072838fbb3333492 Mon Sep 17 00:00:00 2001 From: Andrew Watson Date: Thu, 1 Jul 2021 14:20:57 -0600 Subject: MAINT: fix overly broad exception handling listed in LGTM Relates to ticket #19077 --- numpy/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 12a7cacdc..bfc58c8bd 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -904,7 +904,7 @@ def _lookfor_generate_cache(module, import_modules, regenerate): sys.stdout = old_stdout sys.stderr = old_stderr # Catch SystemExit, too - except BaseException: + except SystemExit: continue for n, v in _getmembers(item): -- cgit v1.2.1 From 5a42312d1ebf2f86e7a9215513585bdd81b4d19b Mon Sep 17 00:00:00 2001 From: Andrew Watson Date: Sat, 3 Jul 2021 08:49:14 -0600 Subject: Update numpy/lib/utils.py Co-authored-by: Matti Picus --- numpy/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index bfc58c8bd..b1a916d4a 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -904,7 +904,7 @@ def _lookfor_generate_cache(module, import_modules, regenerate): sys.stdout = old_stdout sys.stderr = old_stderr # Catch SystemExit, too - except SystemExit: + except (Exception, SystemExit): continue for n, v in _getmembers(item): -- cgit v1.2.1