MCPcopy Index your code
hub / github.com/RustPython/RustPython / _set_locale_in_subprocess

Function _set_locale_in_subprocess

Lib/test/test_c_locale_coercion.py:87–94  ·  view source on GitHub ↗
(locale_name)

Source from the content-addressed store, hash-verified

85)
86
87def _set_locale_in_subprocess(locale_name):
88 cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))"
89 if _check_nl_langinfo_CODESET:
90 # If there's no valid CODESET, we expect coercion to be skipped
91 cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))"
92 cmd = cmd_fmt.format(locale_name)
93 result, py_cmd = run_python_until_end("-c", cmd, PYTHONCOERCECLOCALE='')
94 return result.rc == 0
95
96
97

Callers 1

setUpModuleFunction · 0.85

Calls 2

run_python_until_endFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected