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

login
register
mail settings
Submitter Gregory Szorc
Date Nov. 2, 2019, 7:19 p.m.
Message ID <0d0cd63ca1702b901df2.1572722397@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/42683/
State Accepted
Headers show

Comments

Gregory Szorc - Nov. 2, 2019, 7:19 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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" "$@"