Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3c0d013d
Commit
3c0d013d
authored
Jun 20, 2000
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify that Python raises SyntaxError for long and deeply-nested expressions
parent
94988067
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
Lib/test/output/test_longexp
Lib/test/output/test_longexp
+2
-0
Lib/test/test_longexp.py
Lib/test/test_longexp.py
+18
-0
No files found.
Lib/test/output/test_longexp
0 → 100644
View file @
3c0d013d
test_longexp
Caught SyntaxError for long expression: expression too long
Lib/test/test_longexp.py
0 → 100644
View file @
3c0d013d
REPS
=
8192
try
:
eval
(
"2+2+"
*
REPS
+
"+3.14159265"
)
except
SyntaxError
,
msg
:
print
"Caught SyntaxError for long expression:"
,
msg
else
:
print
"Long expression did not raise SyntaxError"
## This test prints "s_push: parser stack overflow" on stderr,
## which seems to confuse the test harness
##try:
## eval("(2+" * REPS + "0" + ")" * REPS)
##except SyntaxError:
## pass
##else:
## print "Deeply nested expression did not raised SyntaxError"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment