diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2021-08-12 15:28:12 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-08-13 23:14:08 +1000 |
| commit | ee549d725aecbe48c1f8363f5d38855f6d7f47d5 (patch) | |
| tree | 3c4dc32c3b94dc1647b750e3405c3abd52980cfe /tools/gen-cpydiff.py | |
| parent | c737cde9472741337be0c0a66e8e99695c6a9b14 (diff) | |
tools/gen-cpydiff.py: Don't rename foo to ufoo in diff output.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/gen-cpydiff.py')
| -rw-r--r-- | tools/gen-cpydiff.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py index c9f58ec50..1d458d3dc 100644 --- a/tools/gen-cpydiff.py +++ b/tools/gen-cpydiff.py @@ -50,7 +50,6 @@ INDEXTEMPLATE = "../docs/differences/index_template.txt" INDEX = "index.rst" HEADER = ".. This document was generated by tools/gen-cpydiff.py\n\n" -UIMPORTLIST = {"struct", "collections", "json"} CLASSMAP = {"Core": "Core language", "Types": "Builtin types"} INDEXPRIORITY = ["syntax", "core_language", "builtin_types", "modules"] RSTCHARS = ["=", "-", "~", "`", ":"] @@ -94,21 +93,12 @@ def readfiles(): return files -def uimports(code): - """converts CPython module names into MicroPython equivalents""" - for uimport in UIMPORTLIST: - uimport = bytes(uimport, "utf8") - code = code.replace(uimport, b"u" + uimport) - return code - - def run_tests(tests): """executes all tests""" results = [] for test in tests: with open(TESTPATH + test.name, "rb") as f: - input_cpy = f.read() - input_upy = uimports(input_cpy) + input_py = f.read() process = subprocess.Popen( CPYTHON3, @@ -117,7 +107,7 @@ def run_tests(tests): stdin=subprocess.PIPE, stderr=subprocess.PIPE, ) - output_cpy = [com.decode("utf8") for com in process.communicate(input_cpy)] + output_cpy = [com.decode("utf8") for com in process.communicate(input_py)] process = subprocess.Popen( MICROPYTHON, @@ -126,7 +116,7 @@ def run_tests(tests): stdin=subprocess.PIPE, stderr=subprocess.PIPE, ) - output_upy = [com.decode("utf8") for com in process.communicate(input_upy)] + output_upy = [com.decode("utf8") for com in process.communicate(input_py)] if output_cpy[0] == output_upy[0] and output_cpy[1] == output_upy[1]: status = "Supported" |
