Newest python versions have different repr for exceptions, avoid altogether

This commit is contained in:
Alex Hall 2019-05-11 12:28:41 +02:00 committed by Ram Rachum
parent dea100b929
commit 90a1946529
1 changed files with 4 additions and 5 deletions

View File

@ -8,8 +8,8 @@ def foo():
def bar(): def bar():
try: try:
foo() foo()
except Exception as e: except Exception:
str(e) str(1)
raise raise
@ -35,9 +35,8 @@ expected_output = '''
Call ended by exception Call ended by exception
12:18:08.018494 exception 10 foo() 12:18:08.018494 exception 10 foo()
TypeError: bad TypeError: bad
12:18:08.018545 line 11 except Exception as e: 12:26:33.942623 line 11 except Exception:
New var:....... e = TypeError('bad',) 12:26:33.942674 line 12 str(1)
12:18:08.018597 line 12 str(e)
12:18:08.018655 line 13 raise 12:18:08.018655 line 13 raise
Call ended by exception Call ended by exception
12:18:08.018718 exception 19 bar() 12:18:08.018718 exception 19 bar()