Jeremy Hylton | 3c0d013 | 2000-06-20 19:13:27 +0000 | [diff] [blame^] | 1 | REPS = 8192 |
| 2 | |
| 3 | try: |
| 4 | eval("2+2+" * REPS + "+3.14159265") |
| 5 | except SyntaxError, msg: |
| 6 | print "Caught SyntaxError for long expression:", msg |
| 7 | else: |
| 8 | print "Long expression did not raise SyntaxError" |
| 9 | |
| 10 | ## This test prints "s_push: parser stack overflow" on stderr, |
| 11 | ## which seems to confuse the test harness |
| 12 | ##try: |
| 13 | ## eval("(2+" * REPS + "0" + ")" * REPS) |
| 14 | ##except SyntaxError: |
| 15 | ## pass |
| 16 | ##else: |
| 17 | ## print "Deeply nested expression did not raised SyntaxError" |
| 18 | |