[PATCH 2 of 3 STABLE] contrib: require Python 3.6 for byteify-strings.py

Gregory Szorc gregory.szorc at gmail.com
Sat Nov 2 15:19:57 EDT 2019


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1572720518 25200
#      Sat Nov 02 11:48:38 2019 -0700
# Branch stable
# Node ID 0d0cd63ca1702b901df2cc021d1f51c77bc0bf61
# Parent  7ebf53ae3eb60566c1580d8209277372dd43e30a
contrib: require Python 3.6 for byteify-strings.py

This script makes use of `token.COMMENT`, which apparently
isn't present until Python 3.6. So make the script and its
test conditional on Python 3.6.

diff --git a/contrib/byteify-strings.py b/contrib/byteify-strings.py
--- a/contrib/byteify-strings.py
+++ b/contrib/byteify-strings.py
@@ -339,7 +339,7 @@ def main():
 
 
 if __name__ == '__main__':
-    if sys.version_info.major < 3:
-        print('This script must be run under Python 3.')
+    if sys.version_info[0:2] < (3, 6):
+        print('This script must be run under Python 3.6+')
         sys.exit(3)
     main()
diff --git a/tests/test-byteify-strings.t b/tests/test-byteify-strings.t
--- a/tests/test-byteify-strings.t
+++ b/tests/test-byteify-strings.t
@@ -1,4 +1,4 @@
-#require py3
+#require py36
 
   $ byteify_strings () {
   >   $PYTHON "$TESTDIR/../contrib/byteify-strings.py" "$@"


More information about the Mercurial-devel mailing list