summaryrefslogtreecommitdiffstats
path: root/third_party/python/pip_tools/piptools/__init__.py
blob: 9f0c95aa569cccf49ef1a90fa0a7795359bf2bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
import locale

from piptools.click import secho

# Needed for locale.getpreferredencoding(False) to work
# in pip._internal.utils.encoding.auto_decode
try:
    locale.setlocale(locale.LC_ALL, "")
except locale.Error as e:  # pragma: no cover
    # setlocale can apparently crash if locale are uninitialized
    secho("Ignoring error when setting locale: {}".format(e), fg="red")