Skip to content

Commit

Permalink
Handle missing locale.LC_MESSAGES enum on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aiudirog committed Jun 27, 2020
1 parent 8cf258c commit 72f3381
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gssapi/raw/misc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ class GSSError(Exception, metaclass=GSSErrorRegistry):
given code
"""

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

res = []
try:
Expand Down

0 comments on commit 72f3381

Please sign in to comment.