[infer][PR] Fix ValueError: unknown locale: UTF-8

Summary:
Fix locale.getlocale throw ValueError exception, but not catch.
Related issues: #447 #445 #358
Closes https://github.com/facebook/infer/pull/630

Differential Revision: D4834267

Pulled By: jvillard

fbshipit-source-id: c66386b
master
htxs 8 years ago committed by Facebook Github Bot
parent 9a9dec4d96
commit 4933a22991

@ -17,7 +17,7 @@ import os
try: try:
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
CODESET = locale.getlocale(locale.LC_CTYPE)[1] CODESET = locale.getlocale(locale.LC_CTYPE)[1]
except locale.Error: except:
CODESET = None CODESET = None
if CODESET is None: if CODESET is None:
CODESET = 'ascii' CODESET = 'ascii'

Loading…
Cancel
Save