summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2015-09-13 18:50:44 +0200
committerChris Liechti <cliechti@gmx.net>2015-09-13 18:50:44 +0200
commit9f398819029448460e45cb0c028f1e6358c3b7f8 (patch)
treec64cd41fd38af929bdc8f58da92c079acf63230a
parentbe00ee9935fa082bfa42f4e4d44a4d73c40aaa8d (diff)
downloadpyserial-git-9f398819029448460e45cb0c028f1e6358c3b7f8.tar.gz
miniterm: use unichr instead of u'' literals (support for < python 3.4)
-rw-r--r--serial/tools/miniterm.py10
1 files 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):