diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/makeqstrdata.py | 11 | ||||
-rw-r--r-- | py/makeqstrdefs.py | 2 | ||||
-rw-r--r-- | py/makeversionhdr.py | 14 |
3 files changed, 4 insertions, 23 deletions
diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 3a9c7aff5..8cd9bdc70 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -1,7 +1,7 @@ """ Process raw qstr file and output qstr data with length, hash and data bytes. -This script works with Python 2.6, 2.7, 3.3 and 3.4. +This script works with Python 3.3+. """ from __future__ import print_function @@ -9,13 +9,7 @@ from __future__ import print_function import re import sys -# Python 2/3/MicroPython compatibility: -# - iterating through bytes is different -# - codepoint2name from html.entities is hard-coded -if sys.version_info[0] == 2: - bytes_cons = lambda val, enc=None: bytearray(val) -elif sys.version_info[0] == 3: # Also handles MicroPython - bytes_cons = bytes +bytes_cons = bytes # fmt: off codepoint2name = { @@ -57,7 +51,6 @@ codepoint2name = { 253: "yacute", 165: "yen", 255: "yuml", 950: "zeta", 8205: "zwj", 8204: "zwnj" } # fmt: on -# end compatibility code codepoint2name[ord("-")] = "hyphen" diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py index 8e930ef50..3f53e1ff3 100644 --- a/py/makeqstrdefs.py +++ b/py/makeqstrdefs.py @@ -2,7 +2,7 @@ This script processes the output from the C preprocessor and extracts all qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'. -This script works with Python 2.6, 2.7, 3.3 and 3.4. +This script works with Python 3.3+. """ from __future__ import print_function diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 5c73501b3..aec95f08e 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -1,7 +1,7 @@ """ Generate header file with macros defining MicroPython version info. -This script works with Python 2.6, 2.7, 3.3 and 3.4. +This script works with Python 3.3+. """ from __future__ import print_function @@ -22,12 +22,6 @@ import subprocess # "vX.Y.Z-preview.N.gHASH.dirty" -- building at any subsequent commit in the cycle # with local changes def get_version_info_from_git(repo_path): - # Python 2.6 doesn't have check_output, so check for that - try: - subprocess.check_output - except AttributeError: - return None - # Note: git describe doesn't work if no tag is available try: git_tag = subprocess.check_output( @@ -57,12 +51,6 @@ def get_version_info_from_git(repo_path): def get_hash_from_git(repo_path): - # Python 2.6 doesn't have check_output, so check for that. - try: - subprocess.check_output - except AttributeError: - return None - try: return subprocess.check_output( ["git", "rev-parse", "--short", "HEAD"], |