Skip to content

Commit 394b8ca

Browse files
committed
Some cleanup
1 parent ceef840 commit 394b8ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def readline(self, size=-1):
157157

158158
curses.raw(True)
159159
try:
160-
while not (buffer.endswith('\n') or buffer.endswith('\r')):
160+
while not buffer.endswith(('\n', '\r')):
161161
key = self.interface.get_key()
162162
if key in [curses.erasechar(), 'KEY_BACKSPACE']:
163163
y, x = self.interface.scr.getyx()
@@ -1638,6 +1638,7 @@ def gethw():
16381638
"""
16391639

16401640
if platform.system() != 'Windows':
1641+
import struct
16411642
h, w = struct.unpack(
16421643
"hhhh",
16431644
fcntl.ioctl(sys.__stdout__, termios.TIOCGWINSZ, "\000" * 8))[0:2]

0 commit comments

Comments
 (0)