Skip to content

Commit

Permalink
Be tighter with the exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Oct 27, 2017
1 parent 962e8f8 commit 43cb163
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion importlib_resources/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,17 @@ def setUpClass(cls):
def tearDownClass(cls):
try:
sys.path.remove(cls._zip_path)
except ValueError:
pass

try:
del sys.path_importer_cache[cls._zip_path]
del sys.modules[cls.data.__spec__.name]
except KeyError:
pass

try:
del cls.data
del cls._zip_path
except (KeyError, ValueError):
except AttributeError:
pass

0 comments on commit 43cb163

Please sign in to comment.