Commit f01b27d2 authored by Kirill Smelkov's avatar Kirill Smelkov

bigfile/py/test_basic: Rework exception testing codepath so it is active on py3 also

As comments being removed states "on python3 exception state is cleared
upon exiting from `except`" - so let's move exc_* fetching under except
clause - this way we'll get correct exception objects on both py2 and py3.
parent ca7c1b6d
...@@ -132,15 +132,10 @@ def test_pagefault_savestate(): ...@@ -132,15 +132,10 @@ def test_pagefault_savestate():
# state, and say we are done ok # state, and say we are done ok
try: try:
1/0 1/0
except ZeroDivisionError: except:
pass
exc_type, exc_value, exc_traceback = sys.exc_info() exc_type, exc_value, exc_traceback = sys.exc_info()
if PY2:
assert exc_type is ZeroDivisionError assert exc_type is ZeroDivisionError
else:
# on python3 exception state is cleared upon exiting from `except`
assert exc_type is None
# NOTE there is a loop created here: # NOTE there is a loop created here:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment