mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 10:11:14 +00:00
#486: Use alternative encoding when sys.stdout.encoding is None
Fix #486
This commit is contained in:
parent
f604756cb7
commit
047efd5575
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import msvcrt
|
import msvcrt
|
||||||
import win_unicode_console
|
import win_unicode_console
|
||||||
@ -22,4 +23,5 @@ def get_key():
|
|||||||
if ch == b'P':
|
if ch == b'P':
|
||||||
return const.KEY_DOWN
|
return const.KEY_DOWN
|
||||||
|
|
||||||
return ch.decode(sys.stdout.encoding)
|
encoding = sys.stdout.encoding or os.environ.get('PYTHONIOENCODING', 'utf-8')
|
||||||
|
return ch.decode(encoding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user