Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44c36bb

Browse files
committed
Add call to setlocale(LC_ALL, "").
1 parent 9601315 commit 44c36bb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Modules/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ PERFORMANCE OF THIS SOFTWARE.
3737
#include <unistd.h>
3838
#endif
3939

40+
#ifdef HAVE_LOCALE_H
41+
#include <locale.h>
42+
#endif
43+
4044
#ifdef MS_WINDOWS
4145
#include <fcntl.h>
4246
#endif
@@ -101,6 +105,10 @@ Py_Main(argc, argv)
101105
int unbuffered = 0;
102106
int stdin_is_interactive = 0;
103107

108+
#ifdef HAVE_SETLOCALE
109+
setlocale(LC_ALL, "");
110+
#endif
111+
104112
orig_argc = argc; /* For Py_GetArgcArgv() */
105113
orig_argv = argv;
106114

@@ -109,7 +117,6 @@ Py_Main(argc, argv)
109117
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
110118
unbuffered = 1;
111119

112-
Py_UseClassExceptionsFlag = 1;
113120
while ((c = getopt(argc, argv, "c:diOSuvX")) != EOF) {
114121
if (c == 'c') {
115122
/* -c is the last option; following arguments

0 commit comments

Comments
 (0)