Skip to content

Commit b3f5dc9

Browse files
committed
backport changes from mpy-cross-v6.2 v1.1.1
1 parent 7d14278 commit b3f5dc9

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.1"
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
@@ -37,6 +37,19 @@ def test_compile_with_syntax_error():
3737
assert mpy is None
3838

3939

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

0 commit comments

Comments
 (0)