mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Use a newer API for creating the module so we don't have to create
the docstring manually. Saves code and a call to PyString_FromString. (There are still more calls to PyString_FromString.)
This commit is contained in:
parent
56dc955049
commit
f9e115abf5
1 changed files with 1 additions and 5 deletions
|
@ -645,7 +645,7 @@ init_locale(void)
|
|||
int i;
|
||||
#endif
|
||||
|
||||
m = Py_InitModule("_locale", PyLocale_Methods);
|
||||
m = Py_InitModule3("_locale", PyLocale_Methods, locale__doc__);
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
||||
|
@ -688,10 +688,6 @@ init_locale(void)
|
|||
Error = PyErr_NewException("locale.Error", NULL, NULL);
|
||||
PyDict_SetItemString(d, "Error", Error);
|
||||
|
||||
x = PyString_FromString(locale__doc__);
|
||||
PyDict_SetItemString(d, "__doc__", x);
|
||||
Py_XDECREF(x);
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
for (i = 0; langinfo_constants[i].name; i++) {
|
||||
PyModule_AddIntConstant(m, langinfo_constants[i].name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue