mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Remove direct manipulation of the module dict.
This commit is contained in:
		
							parent
							
								
									8f3078b3f0
								
							
						
					
					
						commit
						a2bd8d3816
					
				
					 1 changed files with 3 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -463,21 +463,15 @@ static char *unicodedata_docstring = "unicode character database";
 | 
			
		|||
DL_EXPORT(void)
 | 
			
		||||
initunicodedata(void)
 | 
			
		||||
{
 | 
			
		||||
    PyObject *m, *d, *v;
 | 
			
		||||
    PyObject *m, *v;
 | 
			
		||||
 | 
			
		||||
    m = Py_InitModule3(
 | 
			
		||||
        "unicodedata", unicodedata_functions, unicodedata_docstring);
 | 
			
		||||
    if (!m)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    d = PyModule_GetDict(m);
 | 
			
		||||
    if (!d)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    /* Export C API */
 | 
			
		||||
    v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
 | 
			
		||||
    if (v != NULL) {
 | 
			
		||||
        PyDict_SetItemString(d, "ucnhash_CAPI", v);
 | 
			
		||||
        Py_DECREF(v);
 | 
			
		||||
    }
 | 
			
		||||
    if (v != NULL)
 | 
			
		||||
        PyModule_AddObject(m, "ucnhash_CAPI", v);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue