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
3a081f52
Commit
3a081f52
authored
Jul 29, 2011
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 12514: Use try/finally to assure that timeit restores GC when done.
parent
ef4902af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
Lib/timeit.py
Lib/timeit.py
+5
-3
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/timeit.py
View file @
3a081f52
...
...
@@ -191,9 +191,11 @@ class Timer:
it
=
[
None
]
*
number
gcold
=
gc
.
isenabled
()
gc
.
disable
()
timing
=
self
.
inner
(
it
,
self
.
timer
)
if
gcold
:
gc
.
enable
()
try
:
timing
=
self
.
inner
(
it
,
self
.
timer
)
finally
:
if
gcold
:
gc
.
enable
()
return
timing
def
repeat
(
self
,
repeat
=
default_repeat
,
number
=
default_number
):
...
...
Misc/ACKS
View file @
3a081f52
...
...
@@ -722,6 +722,7 @@ Chris Rebert
Marc Recht
John Redford
Terry Reedy
Gareth Rees
Steve Reeves
Lennart Regebro
Ofir Reichenberg
...
...
Misc/NEWS
View file @
3a081f52
...
...
@@ -39,6 +39,9 @@ Library
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
- Issue #12514: Use try/finally to assure the timeit module restores garbage
collections when it is done.
- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
...
...
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