Commit 5c16c7b0 authored by Neal Norwitz's avatar Neal Norwitz

Move declaration of enc to scope where it is used

parent 4efd9171
......@@ -190,11 +190,10 @@ Py_Initialize(void)
if (!Py_FileSystemDefaultEncoding) {
char *saved_locale = setlocale(LC_CTYPE, NULL);
char *codeset;
PyObject *enc = NULL;
setlocale(LC_CTYPE, "");
codeset = nl_langinfo(CODESET);
if (*codeset) {
enc = PyCodec_Encoder(codeset);
PyObject *enc = PyCodec_Encoder(codeset);
if (enc) {
Py_FileSystemDefaultEncoding = strdup(codeset);
Py_DECREF(enc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment