summaryrefslogtreecommitdiff
path: root/Lib/curses/ascii.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-08-29 18:50:59 +0000
committerAndrew M. Kuchling <amk@amk.ca>2003-08-29 18:50:59 +0000
commit02ef8985b6a46e8af6b8bd14fa8cd0a79efade8b (patch)
tree0998bfdf5757948122569cbfebb6666acc7a98a6 /Lib/curses/ascii.py
parent59656b7aae81a3912d2e3456d84e08cf448c6f39 (diff)
downloadcpython-02ef8985b6a46e8af6b8bd14fa8cd0a79efade8b.tar.gz
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/ascii.py')
-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 08b5b79f5f..800fd8b4b7 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: