summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_localemodule.c.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-10-31 00:32:11 (GMT)
committerGitHub <noreply@github.com>2020-10-31 00:32:11 (GMT)
commitb62bdf71ea0cd52041d49691d8ae3dc645bd48e1 (patch)
tree376fe1864673d8de21c8621629765cd1a28cdb1b /Modules/clinic/_localemodule.c.h
parent710e82630775774dceba5e8f24b1b10e6dfaf9b7 (diff)
downloadcpython-b62bdf71ea0cd52041d49691d8ae3dc645bd48e1.zip
cpython-b62bdf71ea0cd52041d49691d8ae3dc645bd48e1.tar.gz
cpython-b62bdf71ea0cd52041d49691d8ae3dc645bd48e1.tar.bz2
bpo-42208: Add _locale._get_locale_encoding() (GH-23052)
* Add a new _locale._get_locale_encoding() function to get the current locale encoding. * Modify locale.getpreferredencoding() to use it. * Remove the _bootlocale module.
Diffstat (limited to 'Modules/clinic/_localemodule.c.h')
-rw-r--r--Modules/clinic/_localemodule.c.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/Modules/clinic/_localemodule.c.h b/Modules/clinic/_localemodule.c.h
index 5d1db3e..703d034 100644
--- a/Modules/clinic/_localemodule.c.h
+++ b/Modules/clinic/_localemodule.c.h
@@ -545,6 +545,24 @@ exit:
#endif /* defined(HAVE_LIBINTL_H) && defined(HAVE_BIND_TEXTDOMAIN_CODESET) */
+PyDoc_STRVAR(_locale__get_locale_encoding__doc__,
+"_get_locale_encoding($module, /)\n"
+"--\n"
+"\n"
+"Get the current locale encoding.");
+
+#define _LOCALE__GET_LOCALE_ENCODING_METHODDEF \
+ {"_get_locale_encoding", (PyCFunction)_locale__get_locale_encoding, METH_NOARGS, _locale__get_locale_encoding__doc__},
+
+static PyObject *
+_locale__get_locale_encoding_impl(PyObject *module);
+
+static PyObject *
+_locale__get_locale_encoding(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _locale__get_locale_encoding_impl(module);
+}
+
#ifndef _LOCALE_STRCOLL_METHODDEF
#define _LOCALE_STRCOLL_METHODDEF
#endif /* !defined(_LOCALE_STRCOLL_METHODDEF) */
@@ -584,4 +602,4 @@ exit:
#ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
#define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
#endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */
-/*[clinic end generated code: output=fe944779cd572d8e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=cd703c8a3a75fcf4 input=a9049054013a1b77]*/