mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 21:20:13 +01:00
tools/mpremote: Make ConsolePosix work without .raw attribute.
When running mpremote in the vscode terminal on OSX the sys.stdout.buffer does not have the raw attribute. It works fine without it.
This commit is contained in:
committed by
Damien George
parent
1f84440538
commit
d865ca53b5
@@ -11,8 +11,13 @@ except ImportError:
|
||||
class ConsolePosix:
|
||||
def __init__(self):
|
||||
self.infd = sys.stdin.fileno()
|
||||
self.infile = sys.stdin.buffer.raw
|
||||
self.outfile = sys.stdout.buffer.raw
|
||||
self.infile = sys.stdin.buffer
|
||||
self.outfile = sys.stdout.buffer
|
||||
if hasattr(self.infile, "raw"):
|
||||
self.infile = self.infile.raw
|
||||
if hasattr(self.outfile, "raw"):
|
||||
self.outfile = self.outfile.raw
|
||||
|
||||
self.orig_attr = termios.tcgetattr(self.infd)
|
||||
|
||||
def enter(self):
|
||||
|
||||
Reference in New Issue
Block a user