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

Skip to content

Commit 99964b8

Browse files
committed
Marc-Andre Lemburg <[email protected]>:
Changed the API names for setting the default encoding. These are now in line with the other hooks API names (no underscores).
1 parent 90e8147 commit 99964b8

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

Python/sysmodule.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,37 +143,37 @@ If it is another kind of object, it will be printed and the system\n\
143143
exit status will be one (i.e., failure).";
144144

145145
static PyObject *
146-
sys_get_string_encoding(self, args)
146+
sys_getdefaultencoding(self, args)
147147
PyObject *self;
148148
PyObject *args;
149149
{
150-
if (!PyArg_ParseTuple(args, ":get_string_encoding"))
150+
if (!PyArg_ParseTuple(args, ":getdefaultencoding"))
151151
return NULL;
152152
return PyString_FromString(PyUnicode_GetDefaultEncoding());
153153
}
154154

155-
static char get_string_encoding_doc[] =
156-
"get_string_encoding() -> string\n\
155+
static char getdefaultencoding_doc[] =
156+
"getdefaultencoding() -> string\n\
157157
\n\
158158
Return the current default string encoding used by the Unicode \n\
159159
implementation.";
160160

161161
static PyObject *
162-
sys_set_string_encoding(self, args)
162+
sys_setdefaultencoding(self, args)
163163
PyObject *self;
164164
PyObject *args;
165165
{
166166
char *encoding;
167-
if (!PyArg_ParseTuple(args, "s:set_string_encoding", &encoding))
167+
if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding))
168168
return NULL;
169169
if (PyUnicode_SetDefaultEncoding(encoding))
170170
return NULL;
171171
Py_INCREF(Py_None);
172172
return Py_None;
173173
}
174174

175-
static char set_string_encoding_doc[] =
176-
"set_string_encoding(encoding)\n\
175+
static char setdefaultencoding_doc[] =
176+
"setdefaultencoding(encoding)\n\
177177
\n\
178178
Set the current default string encoding used by the Unicode implementation.";
179179

@@ -301,7 +301,7 @@ static PyMethodDef sys_methods[] = {
301301
/* Might as well keep this in alphabetic order */
302302
{"exc_info", sys_exc_info, 1, exc_info_doc},
303303
{"exit", sys_exit, 0, exit_doc},
304-
{"get_string_encoding", sys_get_string_encoding, 1, get_string_encoding_doc},
304+
{"getdefaultencoding", sys_getdefaultencoding, 1, getdefaultencoding_doc},
305305
#ifdef COUNT_ALLOCS
306306
{"getcounts", sys_getcounts, 1},
307307
#endif
@@ -315,7 +315,7 @@ static PyMethodDef sys_methods[] = {
315315
#ifdef USE_MALLOPT
316316
{"mdebug", sys_mdebug, 1},
317317
#endif
318-
{"set_string_encoding", sys_set_string_encoding, 1, set_string_encoding_doc},
318+
{"setdefaultencoding", sys_setdefaultencoding, 1, setdefaultencoding_doc},
319319
{"setcheckinterval", sys_setcheckinterval, 1, setcheckinterval_doc},
320320
{"setprofile", sys_setprofile, 0, setprofile_doc},
321321
{"settrace", sys_settrace, 0, settrace_doc},

0 commit comments

Comments
 (0)