@@ -363,38 +363,6 @@ PyLocale_getdefaultlocale(PyObject* self)
363363}
364364#endif
365365
366- #if defined(__APPLE__ )
367- /*
368- ** Find out what the current script is.
369- ** Donated by Fredrik Lundh.
370- */
371- static char * mac_getscript (void )
372- {
373- CFStringEncoding enc = CFStringGetSystemEncoding ();
374- static CFStringRef name = NULL ;
375- /* Return the code name for the encodings for which we have codecs. */
376- switch (enc ) {
377- case kCFStringEncodingMacRoman : return "mac-roman" ;
378- case kCFStringEncodingMacGreek : return "mac-greek" ;
379- case kCFStringEncodingMacCyrillic : return "mac-cyrillic" ;
380- case kCFStringEncodingMacTurkish : return "mac-turkish" ;
381- case kCFStringEncodingMacIcelandic : return "mac-icelandic" ;
382- /* XXX which one is mac-latin2? */
383- }
384- if (!name ) {
385- /* This leaks an object. */
386- name = CFStringConvertEncodingToIANACharSetName (enc );
387- }
388- return (char * )CFStringGetCStringPtr (name , 0 );
389- }
390-
391- static PyObject *
392- PyLocale_getdefaultlocale (PyObject * self )
393- {
394- return Py_BuildValue ("Os" , Py_None , mac_getscript ());
395- }
396- #endif
397-
398366#ifdef HAVE_LANGINFO_H
399367#define LANGINFO (X ) {#X, X}
400368static struct langinfo_constant {
@@ -645,7 +613,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
645613 {"strxfrm" , (PyCFunction ) PyLocale_strxfrm ,
646614 METH_VARARGS , strxfrm__doc__ },
647615#endif
648- #if defined(MS_WINDOWS ) || defined ( __APPLE__ )
616+ #if defined(MS_WINDOWS )
649617 {"_getdefaultlocale" , (PyCFunction ) PyLocale_getdefaultlocale , METH_NOARGS },
650618#endif
651619#ifdef HAVE_LANGINFO_H
0 commit comments