Skip to content

Commit

Permalink
Merge pull request #22387 from charris/backport-22356
Browse files Browse the repository at this point in the history
REV: Loosen ``lookfor``'s import try/except again
  • Loading branch information
charris committed Oct 6, 2022
2 parents 611fadc + 6b08030 commit a35df7c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions numpy/lib/utils.py
Expand Up @@ -907,8 +907,12 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr
# Catch SystemExit, too
except (Exception, SystemExit):
except KeyboardInterrupt:
# Assume keyboard interrupt came from a user
raise
except BaseException:
# Ignore also SystemExit and pytests.importorskip
# `Skipped` (these are BaseExceptions; gh-22345)
continue

for n, v in _getmembers(item):
Expand Down

0 comments on commit a35df7c

Please sign in to comment.