mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Marc-Andre Lemburg <mal@lemburg.com>:
Changed the API names for setting the default encoding. These are now in line with the other hooks API names (no underscores).
This commit is contained in:
		
							parent
							
								
									90e8147118
								
							
						
					
					
						commit
						99964b86b2
					
				
					 1 changed files with 10 additions and 10 deletions
				
			
		|  | @ -143,28 +143,28 @@ If it is another kind of object, it will be printed and the system\n\ | ||||||
| exit status will be one (i.e., failure)."; | exit status will be one (i.e., failure)."; | ||||||
| 
 | 
 | ||||||
| static PyObject * | static PyObject * | ||||||
| sys_get_string_encoding(self, args) | sys_getdefaultencoding(self, args) | ||||||
| 	PyObject *self; | 	PyObject *self; | ||||||
| 	PyObject *args; | 	PyObject *args; | ||||||
| { | { | ||||||
| 	if (!PyArg_ParseTuple(args, ":get_string_encoding")) | 	if (!PyArg_ParseTuple(args, ":getdefaultencoding")) | ||||||
| 		return NULL; | 		return NULL; | ||||||
| 	return PyString_FromString(PyUnicode_GetDefaultEncoding()); | 	return PyString_FromString(PyUnicode_GetDefaultEncoding()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static char get_string_encoding_doc[] = | static char getdefaultencoding_doc[] = | ||||||
| "get_string_encoding() -> string\n\
 | "getdefaultencoding() -> string\n\
 | ||||||
| \n\ | \n\ | ||||||
| Return the current default string encoding used by the Unicode \n\ | Return the current default string encoding used by the Unicode \n\ | ||||||
| implementation."; | implementation."; | ||||||
| 
 | 
 | ||||||
| static PyObject * | static PyObject * | ||||||
| sys_set_string_encoding(self, args) | sys_setdefaultencoding(self, args) | ||||||
| 	PyObject *self; | 	PyObject *self; | ||||||
| 	PyObject *args; | 	PyObject *args; | ||||||
| { | { | ||||||
| 	char *encoding; | 	char *encoding; | ||||||
| 	if (!PyArg_ParseTuple(args, "s:set_string_encoding", &encoding)) | 	if (!PyArg_ParseTuple(args, "s:setdefaultencoding", &encoding)) | ||||||
| 		return NULL; | 		return NULL; | ||||||
| 	if (PyUnicode_SetDefaultEncoding(encoding)) | 	if (PyUnicode_SetDefaultEncoding(encoding)) | ||||||
| 	    	return NULL; | 	    	return NULL; | ||||||
|  | @ -172,8 +172,8 @@ sys_set_string_encoding(self, args) | ||||||
| 	return Py_None; | 	return Py_None; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static char set_string_encoding_doc[] = | static char setdefaultencoding_doc[] = | ||||||
| "set_string_encoding(encoding)\n\
 | "setdefaultencoding(encoding)\n\
 | ||||||
| \n\ | \n\ | ||||||
| Set the current default string encoding used by the Unicode implementation."; | Set the current default string encoding used by the Unicode implementation."; | ||||||
| 
 | 
 | ||||||
|  | @ -301,7 +301,7 @@ static PyMethodDef sys_methods[] = { | ||||||
| 	/* Might as well keep this in alphabetic order */ | 	/* Might as well keep this in alphabetic order */ | ||||||
| 	{"exc_info",	sys_exc_info, 1, exc_info_doc}, | 	{"exc_info",	sys_exc_info, 1, exc_info_doc}, | ||||||
| 	{"exit",	sys_exit, 0, exit_doc}, | 	{"exit",	sys_exit, 0, exit_doc}, | ||||||
| 	{"get_string_encoding", sys_get_string_encoding, 1, get_string_encoding_doc}, | 	{"getdefaultencoding", sys_getdefaultencoding, 1, getdefaultencoding_doc}, | ||||||
| #ifdef COUNT_ALLOCS | #ifdef COUNT_ALLOCS | ||||||
| 	{"getcounts",	sys_getcounts, 1}, | 	{"getcounts",	sys_getcounts, 1}, | ||||||
| #endif | #endif | ||||||
|  | @ -315,7 +315,7 @@ static PyMethodDef sys_methods[] = { | ||||||
| #ifdef USE_MALLOPT | #ifdef USE_MALLOPT | ||||||
| 	{"mdebug",	sys_mdebug, 1}, | 	{"mdebug",	sys_mdebug, 1}, | ||||||
| #endif | #endif | ||||||
| 	{"set_string_encoding", sys_set_string_encoding, 1, set_string_encoding_doc}, | 	{"setdefaultencoding", sys_setdefaultencoding, 1, setdefaultencoding_doc}, | ||||||
| 	{"setcheckinterval",	sys_setcheckinterval, 1, setcheckinterval_doc}, | 	{"setcheckinterval",	sys_setcheckinterval, 1, setcheckinterval_doc}, | ||||||
| 	{"setprofile",	sys_setprofile, 0, setprofile_doc}, | 	{"setprofile",	sys_setprofile, 0, setprofile_doc}, | ||||||
| 	{"settrace",	sys_settrace, 0, settrace_doc}, | 	{"settrace",	sys_settrace, 0, settrace_doc}, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Marc-André Lemburg
						Marc-André Lemburg