mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
Issue 12514: Use try/finally to assure that timeit restores GC when done.
This commit is contained in:
parent
ef4902af87
commit
3a081f526d
3 changed files with 9 additions and 3 deletions
|
@ -191,7 +191,9 @@ class Timer:
|
||||||
it = [None] * number
|
it = [None] * number
|
||||||
gcold = gc.isenabled()
|
gcold = gc.isenabled()
|
||||||
gc.disable()
|
gc.disable()
|
||||||
|
try:
|
||||||
timing = self.inner(it, self.timer)
|
timing = self.inner(it, self.timer)
|
||||||
|
finally:
|
||||||
if gcold:
|
if gcold:
|
||||||
gc.enable()
|
gc.enable()
|
||||||
return timing
|
return timing
|
||||||
|
|
|
@ -722,6 +722,7 @@ Chris Rebert
|
||||||
Marc Recht
|
Marc Recht
|
||||||
John Redford
|
John Redford
|
||||||
Terry Reedy
|
Terry Reedy
|
||||||
|
Gareth Rees
|
||||||
Steve Reeves
|
Steve Reeves
|
||||||
Lennart Regebro
|
Lennart Regebro
|
||||||
Ofir Reichenberg
|
Ofir Reichenberg
|
||||||
|
|
|
@ -39,6 +39,9 @@ Library
|
||||||
|
|
||||||
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
|
- 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
|
- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
|
||||||
given as a low fd, it gets overwritten.
|
given as a low fd, it gets overwritten.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue