Mercurial > public > mercurial-scm > hg-stable
diff tests/fsmonitor-run-tests.py @ 53031:e705fec4a03f stable
branching: merging with 7.0 changes
Since 6.9.3 was made after 7.0rc0 we need to deal with more branching than
usual.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 05 Mar 2025 23:02:19 +0100 |
parents | 70a75d379daf |
children |
line wrap: on
line diff
--- a/tests/fsmonitor-run-tests.py Wed Mar 05 22:33:11 2025 +0100 +++ b/tests/fsmonitor-run-tests.py Wed Mar 05 23:02:19 2025 +0100 @@ -24,27 +24,21 @@ osenvironb = getattr(os, 'environb', os.environ) -if sys.version_info > (3, 5, 0): - PYTHON3 = True +# Don't compare sys.version_info directly, to prevent pyupgrade from dropping +# the conditional. +sys_version_info = sys.version_info + +if sys_version_info >= (3, 8, 0): def _sys2bytes(p): return p.encode('utf-8') -elif sys.version_info >= (3, 0, 0): +else: print( - '%s is only supported on Python 3.5+ and 2.7, not %s' + '%s is only supported on Python 3.8+, not %s' % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3])) ) sys.exit(70) # EX_SOFTWARE from `man 3 sysexit` -else: - PYTHON3 = False - - # In python 2.x, path operations are generally done using - # bytestrings by default, so we don't have to do any extra - # fiddling there. We define the wrapper functions anyway just to - # help keep code consistent between platforms. - def _sys2bytes(p): - return p def getparser():