Skip to content

Commit 412513a

Browse files
committed
Fixed a curses error for terminals which do not support setting the cursor, by Marien Zwart
1 parent 9cdf92d commit 412513a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bpython/formatter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ def __init__(self, color_scheme, **options):
101101

102102
def format(self, tokensource, outfile):
103103
o = ''
104-
curses.curs_set(1)
104+
105+
try:
106+
curses.curs_set(1)
107+
except curses.error:
108+
# We are in a sucky terminal emulator that does not support it.
109+
pass
110+
105111
for token, text in tokensource:
106112
if text == '\n':
107113
continue

0 commit comments

Comments
 (0)