Skip to content

Commit 89e2f64

Browse files
committed
Refactor
1 parent 9004acc commit 89e2f64

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

bpython/urwid.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,11 @@ def _on_prompt_enter(self, edit, new_text):
225225
urwid.register_signal(Statusbar, "prompt_result")
226226

227227

228-
def decoding_input_filter(keys, raw):
228+
def decoding_input_filter(keys: list[str], _raw: list[int]) -> list[str]:
229229
"""Input filter for urwid which decodes each key with the locale's
230230
preferred encoding.'"""
231231
encoding = locale.getpreferredencoding()
232-
converted_keys = list()
233-
for key in keys:
234-
if isinstance(key, str):
235-
converted_keys.append(key.decode(encoding))
236-
else:
237-
converted_keys.append(key)
238-
return converted_keys
232+
return [key.decode(encoding) for key in keys]
239233

240234

241235
def format_tokens(tokensource):

0 commit comments

Comments
 (0)