mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Move declaration of enc to scope where it is used
This commit is contained in:
parent
4efd91713b
commit
5c16c7b014
1 changed files with 1 additions and 2 deletions
|
@ -190,11 +190,10 @@ Py_Initialize(void)
|
||||||
if (!Py_FileSystemDefaultEncoding) {
|
if (!Py_FileSystemDefaultEncoding) {
|
||||||
char *saved_locale = setlocale(LC_CTYPE, NULL);
|
char *saved_locale = setlocale(LC_CTYPE, NULL);
|
||||||
char *codeset;
|
char *codeset;
|
||||||
PyObject *enc = NULL;
|
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
codeset = nl_langinfo(CODESET);
|
codeset = nl_langinfo(CODESET);
|
||||||
if (*codeset) {
|
if (*codeset) {
|
||||||
enc = PyCodec_Encoder(codeset);
|
PyObject *enc = PyCodec_Encoder(codeset);
|
||||||
if (enc) {
|
if (enc) {
|
||||||
Py_FileSystemDefaultEncoding = strdup(codeset);
|
Py_FileSystemDefaultEncoding = strdup(codeset);
|
||||||
Py_DECREF(enc);
|
Py_DECREF(enc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue