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
5c3ddc80
Commit
5c3ddc80
authored
Aug 17, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #15632: regrtest.py: fix spurious refleaks due to various caches
filling up with random data.
parent
6aaa03a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Lib/test/regrtest.py
Lib/test/regrtest.py
+9
-4
No files found.
Lib/test/regrtest.py
View file @
5c3ddc80
...
...
@@ -381,9 +381,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
huntrleaks
[
1
]
=
int
(
huntrleaks
[
1
])
if
len
(
huntrleaks
)
==
2
or
not
huntrleaks
[
2
]:
huntrleaks
[
2
:]
=
[
"reflog.txt"
]
# Avoid false positives due to
the character cache in
#
stringobject.c filling slowly with random data
warm_c
har_cache
()
# Avoid false positives due to
various caches
#
filling slowly with random data:
warm_c
aches
()
elif
o
in
(
'-M'
,
'--memlimit'
):
support
.
set_memlimit
(
a
)
elif
o
in
(
'-u'
,
'--use'
):
...
...
@@ -1430,10 +1430,15 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
# Collect cyclic trash.
gc.collect()
def warm_char_cache():
def warm_caches():
# char cache
s = bytes(range(256))
for i in range(256):
s[i:i+1]
# unicode cache
x = [chr(i) for i in range(256)]
# int cache
x = list(range(-5, 257))
def findtestdir(path=None):
return path or os.path.dirname(__file__) or os.curdir
...
...
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