File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,9 +191,11 @@ def timeit(self, number=default_number):
191191 it = [None ] * number
192192 gcold = gc .isenabled ()
193193 gc .disable ()
194- timing = self .inner (it , self .timer )
195- if gcold :
196- gc .enable ()
194+ try :
195+ timing = self .inner (it , self .timer )
196+ finally :
197+ if gcold :
198+ gc .enable ()
197199 return timing
198200
199201 def repeat (self , repeat = default_repeat , number = default_number ):
Original file line number Diff line number Diff line change @@ -771,6 +771,7 @@ Chris Rebert
771771Marc Recht
772772John Redford
773773Terry Reedy
774+ Gareth Rees
774775Steve Reeves
775776Lennart Regebro
776777Ofir Reichenberg
Original file line number Diff line number Diff line change @@ -246,6 +246,9 @@ Library
246246
247247- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
248248
249+ - Issue #12514: Use try/finally to assure the timeit module restores garbage
250+ collections when it is done.
251+
249252- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
250253 given as a low fd, it gets overwritten.
251254
You can’t perform that action at this time.
0 commit comments