mirror of
https://github.com/facebook/sapling.git
synced 2024-12-28 15:44:27 +03:00
curses: eat curses error for weird inputs
Summary: In python 3 curses sometimes throws an error when weird keys are pressed. I'm not certain exactly what key causes the problem, but let's just prevent all such errors from crashing the process. Reviewed By: quark-zju Differential Revision: D23310301 fbshipit-source-id: a9684ce6f690d0753ff9956ef9f13c330eb0a77b
This commit is contained in:
parent
9e9d4a5b2b
commit
4a8a5290e8
@ -1743,9 +1743,15 @@ are you sure you want to review/edit and confirm the selected changes [yn]?
|
||||
self.helpwindow()
|
||||
self.stdscr.clear()
|
||||
self.stdscr.refresh()
|
||||
elif len(keypressed) == 1 and curses.unctrl(keypressed) in [b"^L"]:
|
||||
else:
|
||||
try:
|
||||
if len(keypressed) == 1 and curses.unctrl(keypressed) in [b"^L"]:
|
||||
# scroll the current line to the top of the screen
|
||||
self.scrolllines(self.selecteditemstartline)
|
||||
except OverflowError:
|
||||
# curses sometimes throws a "OverflowError: byte doesn't fit in
|
||||
# chtype" error.
|
||||
pass
|
||||
|
||||
def main(self, stdscr):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user