(locale_name)
| 85 | ) |
| 86 | |
| 87 | def _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 |
no test coverage detected