Skip to content

Commit a08db5f

Browse files
committed
pybricksdev.connections.pybricks: fix write_line endline
While Miropython prints `\r\n` for endlines, when receiving input, it only looks for `\n`.
1 parent 33056f4 commit a08db5f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Fixed endline in `PybricksHub.write_line()`.
11+
912
## [1.0.0-alpha.44] - 2023-04-20
1013

1114
### Fixed

pybricksdev/connections/pybricks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,13 @@ async def write_string(self, value: str) -> None:
389389

390390
async def write_line(self, value: str) -> None:
391391
"""
392-
Writes a string to stdin on the hub and adds a newline (``\\r\\n``)
392+
Writes a string to stdin on the hub and adds a newline (``\\n``)
393393
to the end.
394394
395395
Args:
396396
value: The string to write.
397397
"""
398-
await self.write_string(value + self.EOL.decode())
398+
await self.write_string(value + "\n")
399399

400400
async def read_line(self) -> str:
401401
"""

0 commit comments

Comments
 (0)