summaryrefslogtreecommitdiffstatshomepage
path: root/tests/stress/recursive_data.py
blob: 6e01319ed3a369015f651af4b3beebc1e2279add (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# This tests that printing recursive data structure doesn't lead to segfault.
try:
    import io
except ImportError:
    print("SKIP")
    raise SystemExit

l = [1, 2, 3, None]
l[-1] = l
try:
    print(l, file=io.StringIO())
except RuntimeError:
    print("RuntimeError")