Commits

Armin Rigo committed 4df6614

On PyPy or other non-CPython implementations, calling gc.disable() in timeit.py is bogus.

  • Participants
  • Parent commits 8b134bc

Comments (0)

Files changed (1)

File lib-python/2.7/timeit.py

         else:
             it = [None] * number
         gcold = gc.isenabled()
-        gc.disable()
+        if '__pypy__' not in sys.builtin_module_names:
+            gc.disable()    # only do that on CPython
         try:
             timing = self.inner(it, self.timer)
         finally: