Skip to content

Commit 72f3381

Browse files
committed
Handle missing locale.LC_MESSAGES enum on Windows
1 parent 8cf258c commit 72f3381

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gssapi/raw/misc.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,10 @@ class GSSError(Exception, metaclass=GSSErrorRegistry):
291291
given code
292292
"""
293293

294-
msg_encoding = locale.getlocale(locale.LC_MESSAGES)[1] or 'UTF-8'
294+
try:
295+
msg_encoding = locale.getlocale(locale.LC_MESSAGES)[1] or 'UTF-8'
296+
except AttributeError: # Windows doesn't have LC_MESSAGES
297+
msg_encoding = 'UTF-8'
295298

296299
res = []
297300
try:

0 commit comments

Comments
 (0)