Skip to content

Commit fc6a12f

Browse files
committed
-
1 parent 4dc6015 commit fc6a12f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

garlicsim/garlicsim/general_misc/module_tasting/sys_modules_unchanged_assertor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ def __enter__(self):
2929

3030

3131
def __exit__(self, exc_type, exc_value, exc_traceback):
32+
33+
if exc_type:
34+
# If there's an exception, we'll just let it propagate, skipping
35+
# our usual `assert` because the exception we got should get the
36+
# user's attention rather than a possible unwanted module in
37+
# `sys.modules`.
38+
return False
39+
3240
new_modules_in_sys_modules = [module_name for module_name in
3341
sys.modules if module_name not in
3442
self.old_sys_modules]

0 commit comments

Comments
 (0)