Skip to content

Commit bb50fbf

Browse files
committed
fix crash occurring in frozen app only
1 parent 35063e9 commit bb50fbf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pcbasic/compat/win32.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ def _get_oem_encoding():
5757

5858

5959
# if starting from a console, shell will inherit its codepage
60-
# if starting from the gui (stdin.encoding == None), we're using OEM codepage
60+
# if starting from the gui (stdin is None), we're using OEM codepage
6161
OEM_ENCODING = _get_oem_encoding()
62-
SHELL_ENCODING = sys.stdin.encoding or OEM_ENCODING
62+
SHELL_ENCODING = None
63+
if sys.stdin:
64+
SHELL_ENCODING = sys.stdin.encoding
65+
SHELL_ENCODING = SHELL_ENCODING or OEM_ENCODING
6366
# there's also an ACP codepage - this seems to be locale.getpreferredencoding()
6467
#_ACP_ENCODING = 'cp' + str(cdll.kernel32.GetACP())
6568

0 commit comments

Comments
 (0)