Skip to content

Commit 0d545bf

Browse files
committed
backport changes from mpy-cross-v6.1 v1.1.1
1 parent bdd0f63 commit 0d545bf

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-v6"
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
@@ -38,6 +38,19 @@ def test_compile_with_syntax_error():
3838
assert mpy is None
3939

4040

41+
def test_windows_does_not_treat_binary_stdout_as_text():
42+
# 'Hello' creates a \n byte which Windows tries to convert to a \r\n if
43+
# the stdout is treated as text.
44+
p, mpy = mpy_cross_compile("test.py", "print('Hello')")
45+
p.check_returncode()
46+
assert mpy is not None
47+
48+
assert 0x0A in mpy, "Expected binary output to contain a newline byte"
49+
assert (
50+
0x0D not in mpy
51+
), "Expected binary output to not contain a carriage return byte"
52+
53+
4154
def test_version():
4255
ver = mpy_cross_version()
4356

0 commit comments

Comments
 (0)