From 9f398819029448460e45cb0c028f1e6358c3b7f8 Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Sun, 13 Sep 2015 18:50:44 +0200 Subject: miniterm: use unichr instead of u'' literals (support for < python 3.4) --- serial/tools/miniterm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/serial/tools/miniterm.py b/serial/tools/miniterm.py index a5cb163..a17204c 100644 --- a/serial/tools/miniterm.py +++ b/serial/tools/miniterm.py @@ -105,9 +105,9 @@ if os.name == 'nt': def getkey(self): while True: z = msvcrt.getwch() - if z == u'\r': - return u'\n' - elif z in u'\x00\x0e': # functions keys, ignore + if z == unichr(13): + return unichr(10) + elif z in (unichr(0), unichr(0x0e)): # functions keys, ignore msvcrt.getwch() else: return z @@ -136,8 +136,8 @@ elif os.name == 'posix': def getkey(self): c = self.enc_stdin.read(1) - if c == u'\x7f': - c = u'\b' # map the BS key (which yields DEL) to backspace + if c == unichr(0x7f): + c = unichr(8) # map the BS key (which yields DEL) to backspace return c def cleanup(self): -- cgit v1.2.1