comparison mercurial/util.py @ 29787:279cd80059d4

performance: disable workaround for an old bug of Python gc 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
author Maciej Fijalkowski <fijall@gmail.com>
date Thu, 28 Jul 2016 14:18:01 +0200
parents 4d23cd6e2219
children 79add5a4e857
comparison
equal deleted inserted replaced
29786:978b907d9b36 29787:279cd80059d4
879 into. As a workaround, disable GC while building complex (huge) 879 into. As a workaround, disable GC while building complex (huge)
880 containers. 880 containers.
881 881
882 This garbage collector issue have been fixed in 2.7. 882 This garbage collector issue have been fixed in 2.7.
883 """ 883 """
884 if sys.version >= (2, 7):
885 return func
884 def wrapper(*args, **kwargs): 886 def wrapper(*args, **kwargs):
885 gcenabled = gc.isenabled() 887 gcenabled = gc.isenabled()
886 gc.disable() 888 gc.disable()
887 try: 889 try:
888 return func(*args, **kwargs) 890 return func(*args, **kwargs)