@@ -72,44 +72,13 @@ str2uni(const char* s)
7272 assert (res1 != (size_t )-1 );
7373#else
7474 assert (res1 == needed );
75- #endif
76- #ifdef Py_DEBUG
77- {
78- size_t i ;
79- printf ("Decode wchar_t {" );
80- for (i = 0 ; i < res1 ; i ++ ) {
81- wchar_t ch = dest [i ];
82- if (i )
83- printf (" U+%04x" , ch );
84- else
85- printf ("U+%04x" , ch );
86- }
87- printf ("} (len=%u)\n" , res1 );
88- }
8975#endif
9076 res2 = PyUnicode_FromWideChar (dest , res1 );
9177 if (dest != smallbuf )
9278 PyMem_Free (dest );
9379 return res2 ;
9480}
9581
96- #ifdef Py_DEBUG
97- void
98- dump_str (const char * name , const char * value )
99- {
100- size_t i , len = strlen (value );
101- printf ("Decode localeconv() %s: {" , name );
102- for (i = 0 ; i < len ; i ++ ) {
103- unsigned char ch = value [i ];
104- if (i )
105- printf (" 0x%02x" , ch );
106- else
107- printf ("0x%02x" , ch );
108- }
109- printf ("} (len=%u)\n" , len );
110- }
111- #endif
112-
11382/* support functions for formatting floating point numbers */
11483
11584PyDoc_STRVAR (setlocale__doc__ ,
@@ -174,18 +143,12 @@ PyLocale_setlocale(PyObject* self, PyObject* args)
174143
175144 if (locale ) {
176145 /* set locale */
177- #ifdef Py_DEBUG
178- printf ("SET LOCALE \"%s\"\n" , locale );
179- #endif
180146 result = setlocale (category , locale );
181147 if (!result ) {
182148 /* operation failed, no setting was changed */
183149 PyErr_SetString (Error , "unsupported locale setting" );
184150 return NULL ;
185151 }
186- #ifdef Py_DEBUG
187- printf ("SET LOCALE -> %s\n" , result );
188- #endif
189152 result_object = str2uni (result );
190153 if (!result_object )
191154 return NULL ;
@@ -221,20 +184,11 @@ PyLocale_localeconv(PyObject* self)
221184 /* hopefully, the localeconv result survives the C library calls
222185 involved herein */
223186
224- #ifdef Py_DEBUG
225187#define RESULT_STRING (s )\
226- dump_str(#s, l->s); \
227188 x = str2uni(l->s); \
228189 if (!x) goto failed;\
229190 PyDict_SetItemString(result, #s, x);\
230191 Py_XDECREF(x)
231- #else
232- #define RESULT_STRING (s )\
233- x = str2uni(l->s); \
234- if (!x) goto failed;\
235- PyDict_SetItemString(result, #s, x);\
236- Py_XDECREF(x)
237- #endif
238192
239193#define RESULT_INT (i )\
240194 x = PyLong_FromLong(l->i);\
0 commit comments