Skip to content

Commit 8b8f693

Browse files
committed
Fixes CPython hang
1 parent 34c1b54 commit 8b8f693

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎extra_tests/snippets/builtin_exceptions.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import platform
12
import sys
23

34

@@ -145,7 +146,9 @@ class SubError(MyError):
145146
raise e
146147
except MyError as exc:
147148
# It was a segmentation fault before, will print info to stdout:
148-
sys.excepthook(type(exc), exc, exc.__traceback__)
149-
assert isinstance(exc, MyError)
150-
assert exc.__cause__ is None
151-
assert exc.__context__ is e
149+
if platform.python_implementation() == 'RustPython':
150+
# For some reason `CPython` hangs on this code:
151+
sys.excepthook(type(exc), exc, exc.__traceback__)
152+
assert isinstance(exc, MyError)
153+
assert exc.__cause__ is None
154+
assert exc.__context__ is e

0 commit comments

Comments
 (0)