Skip to content

Commit bcea7c2

Browse files
wasadepcottle
authored andcommitted
STY: use .get instead of a try/except
1 parent d58762e commit bcea7c2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/screenControl.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,4 @@ def moveCursor(self):
511511

512512
def getKey(self):
513513
charCode = self.stdscr.getch()
514-
try:
515-
char = mapping[charCode]
516-
except KeyError:
517-
return ''
518-
return char
514+
return mapping.get(charCode, '')

0 commit comments

Comments
 (0)