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