From 15f52f530c4dc1af69e93aae60d81c2008101639 Mon Sep 17 00:00:00 2001 From: Alexandr Shadchin Date: Thu, 8 Dec 2016 17:15:52 +0500 Subject: MAINT: Other cleanup Python < 2.7 and Python3 < 3.4 --- numpy/lib/utils.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 97b93cace..5c364268c 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -916,13 +916,6 @@ def _lookfor_generate_cache(module, import_modules, regenerate): if to_import == '__init__': continue - try: - # Catch SystemExit, too - base_exc = BaseException - except NameError: - # Python 2.4 doesn't have BaseException - base_exc = Exception - try: old_stdout = sys.stdout old_stderr = sys.stderr @@ -933,7 +926,8 @@ def _lookfor_generate_cache(module, import_modules, regenerate): finally: sys.stdout = old_stdout sys.stderr = old_stderr - except base_exc: + # Catch SystemExit, too + except BaseException: continue for n, v in _getmembers(item): -- cgit v1.2.1