summaryrefslogtreecommitdiffstats
path: root/Lib/curses
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-08-29 18:50:59 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-08-29 18:50:59 (GMT)
commitb738041c5db7a04b71ed4c3c8128dabc935ad60b (patch)
tree713c27e3a741413c2ed7c74e41c83da4d43cd45a /Lib/curses
parente8792c1f65ebbcbd7958570c66c6bc4132052c12 (diff)
downloadcpython-b738041c5db7a04b71ed4c3c8128dabc935ad60b.zip
cpython-b738041c5db7a04b71ed4c3c8128dabc935ad60b.tar.gz
cpython-b738041c5db7a04b71ed4c3c8128dabc935ad60b.tar.bz2
Rework previous fix slightly; the &0x20 test seems useless, and the isprint() check mustn't prevent the meta-bit check at the end
Diffstat (limited to 'Lib/curses')
-rw-r--r--Lib/curses/ascii.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/curses/ascii.py b/Lib/curses/ascii.py
index 08b5b79..800fd8b 100644
--- a/Lib/curses/ascii.py
+++ b/Lib/curses/ascii.py
@@ -87,13 +87,11 @@ def alt(c):
return _ctoi(c) | 0x80
def unctrl(c):
- if isprint(c):
- return chr(_ctoi(c))
bits = _ctoi(c)
if bits == 0x7f:
rep = "^?"
- elif bits & 0x20:
- rep = chr((bits & 0x7f) | 0x20)
+ elif isprint(bits & 0x7f):
+ rep = chr(bits & 0x7f)
else:
rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
if bits & 0x80: