# HG changeset patch # User Augie Fackler # Date 2016-10-07 12:01:16 # Node ID dbcef8918bbdd8a64d9f79a37bcfa284a26f3a39 # Parent eaaedad68011e699b9dd341c4e57f15cd0bdbc8c util: correct check of sys.version_info sys.version is a string, and shouldn't be compared against a tuple for version comparisons. This was always true, so we were never disabling gc on 2.6. >>> (2, 7) >= '2.7' True >>> (2, 6) >= '2.7' True diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -881,7 +881,7 @@ def nogc(func): This garbage collector issue have been fixed in 2.7. """ - if sys.version >= (2, 7): + if sys.version_info >= (2, 7): return func def wrapper(*args, **kwargs): gcenabled = gc.isenabled() diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -162,10 +162,10 @@ mercurial/ui.py: error importing: int() can't convert non-string with explicit base (error at util.py:*) mercurial/unionrepo.py: error importing: int() can't convert non-string with explicit base (error at util.py:*) mercurial/url.py: error importing: int() can't convert non-string with explicit base (error at util.py:*) - mercurial/verify.py: error importing module: unorderable types: str() >= tuple() (line *) + mercurial/verify.py: error importing: a bytes-like object is required, not 'str' (error at revset.py:*) mercurial/win32.py: error importing module: No module named 'msvcrt' (line *) mercurial/windows.py: error importing module: No module named 'msvcrt' (line *) - mercurial/wireproto.py: error importing module: unorderable types: str() >= tuple() (line *) + mercurial/wireproto.py: error importing: a bytes-like object is required, not 'str' (error at revset.py:*) #endif