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
3f064693
Commit
3f064693
authored
May 04, 2011
by
Daniel Stutzbach
Browse files
Options
Browse Files
Download
Plain Diff
#11335: Merge from 3.2: Fix memory leak after key function failure in sort
parents
fc20b0c6
eda70b81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
Lib/test/test_sort.py
Lib/test/test_sort.py
+6
-0
No files found.
Lib/test/test_sort.py
View file @
3f064693
...
...
@@ -111,6 +111,12 @@ class TestBase(unittest.TestCase):
s
.
sort
(
key
=
CmpToKey
(
lambda
a
,
b
:
int
(
random
.
random
()
*
3
)
-
1
))
check
(
"an insane function left some permutation"
,
x
,
s
)
if
len
(
x
)
>=
2
:
def
bad_key
(
x
):
raise
RuntimeError
s
=
x
[:]
self
.
assertRaises
(
RuntimeError
,
s
.
sort
,
key
=
bad_key
)
x
=
[
Complains
(
i
)
for
i
in
x
]
s
=
x
[:]
random
.
shuffle
(
s
)
...
...
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