[PATCH] performance: disable workaround for an old bug of Python

Maciej Fijalkowski fijall at gmail.com
Wed Aug 10 14:45:58 UTC 2016


# HG changeset patch
# User Maciej Fijalkowski <fijall at gmail.com>
# Date 1469708281 -7200
#      Thu Jul 28 14:18:01 2016 +0200
# Node ID 300f14ea21432face8d7e6cdcf92ba9d2f1f92dc
# Parent  2f4cd91aaa9a2ad1e4de097a1ec7a59127d51e20
performance: disable workaround for an old bug of Python

Since disabling the gc does things worse for pypy and the bug was
fixed in 2.7, let's only enable it in <2.7

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -852,6 +852,8 @@
 
     This garbage collector issue have been fixed in 2.7.
     """
+    if sys.version >= (2, 7):
+        return func
     def wrapper(*args, **kwargs):
         gcenabled = gc.isenabled()
         gc.disable()


More information about the Mercurial-devel mailing list