Skip to content

Commit baa694a

Browse files
committed
backport changes from mpy-cross-v6 v1.1.1
1 parent de38423 commit baa694a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

micropython

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "mpy-cross-v5"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "Python wrapper for the mpy-cross tool from MicroPython."
99
readme = "README.md"
1010

tests/test_mpy_cross.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ def test_compile_with_syntax_error():
5454
assert mpy is None
5555

5656

57+
def test_windows_does_not_treat_binary_stdout_as_text():
58+
# 'Hello' creates a \n byte which Windows tries to convert to a \r\n if
59+
# the stdout is treated as text.
60+
p, mpy = mpy_cross_compile("test.py", "print('Hello')")
61+
p.check_returncode()
62+
assert mpy is not None
63+
64+
assert 0x0A in mpy, "Expected binary output to contain a newline byte"
65+
assert (
66+
0x0D not in mpy
67+
), "Expected binary output to not contain a carriage return byte"
68+
69+
5770
def test_version():
5871
ver = mpy_cross_version()
5972

0 commit comments

Comments
 (0)