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
8155f8e5
Commit
8155f8e5
authored
Nov 05, 2012
by
Nick Coghlan
Browse files
Options
Browse Files
Download
Plain Diff
Issue #5765: Merge from 3.3
parents
e69bfc3f
10d6ddee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Tools/scripts/find_recursionlimit.py
Tools/scripts/find_recursionlimit.py
+7
-0
No files found.
Tools/scripts/find_recursionlimit.py
View file @
8155f8e5
...
...
@@ -89,6 +89,12 @@ def test_cpickle(_cache={}):
_pickle
.
Pickler
(
io
.
BytesIO
(),
protocol
=-
1
).
dump
(
l
)
_cache
[
n
]
=
l
def
test_compiler_recursion
():
# The compiler uses a scaling factor to support additional levels
# of recursion. This is a sanity check of that scaling to ensure
# it still throws RuntimeError even at higher recursion limits
compile
(
"()"
*
(
10
*
sys
.
getrecursionlimit
()),
"<single>"
,
"single"
)
def
check_limit
(
n
,
test_func_name
):
sys
.
setrecursionlimit
(
n
)
if
test_func_name
.
startswith
(
"test_"
):
...
...
@@ -117,5 +123,6 @@ if __name__ == '__main__':
check_limit
(
limit
,
"test_getattr"
)
check_limit
(
limit
,
"test_getitem"
)
check_limit
(
limit
,
"test_cpickle"
)
check_limit
(
limit
,
"test_compiler_recursion"
)
print
(
"Limit of %d is fine"
%
limit
)
limit
=
limit
+
100
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