mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Instead of using _PyImport_Inittab[] directly, use the new "official"
pointer *PyImport_Inittab which is initialized to _PyImport_Inittab.
This commit is contained in:
		
							parent
							
								
									66959aff68
								
							
						
					
					
						commit
						771c6c8f7a
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -80,6 +80,10 @@ extern long PyOS_GetLastModificationTime(); /* In getmtime.c */ | ||||||
| /* See _PyImport_FixupExtension() below */ | /* See _PyImport_FixupExtension() below */ | ||||||
| static PyObject *extensions = NULL; | static PyObject *extensions = NULL; | ||||||
| 
 | 
 | ||||||
|  | /* This table is defined in config.c: */ | ||||||
|  | extern struct _inittab _PyImport_Inittab[]; | ||||||
|  | 
 | ||||||
|  | struct _inittab *PyImport_Inittab = _PyImport_Inittab; | ||||||
| 
 | 
 | ||||||
| /* Initialize things */ | /* Initialize things */ | ||||||
| 
 | 
 | ||||||
|  | @ -612,9 +616,9 @@ is_builtin(name) | ||||||
| 	char *name; | 	char *name; | ||||||
| { | { | ||||||
| 	int i; | 	int i; | ||||||
| 	for (i = 0; _PyImport_Inittab[i].name != NULL; i++) { | 	for (i = 0; PyImport_Inittab[i].name != NULL; i++) { | ||||||
| 		if (strcmp(name, _PyImport_Inittab[i].name) == 0) { | 		if (strcmp(name, PyImport_Inittab[i].name) == 0) { | ||||||
| 			if (_PyImport_Inittab[i].initfunc == NULL) | 			if (PyImport_Inittab[i].initfunc == NULL) | ||||||
| 				return -1; | 				return -1; | ||||||
| 			else | 			else | ||||||
| 				return 1; | 				return 1; | ||||||
|  | @ -871,7 +875,7 @@ init_builtin(name) | ||||||
| 	if ((mod = _PyImport_FindExtension(name, name)) != NULL) | 	if ((mod = _PyImport_FindExtension(name, name)) != NULL) | ||||||
| 		return 1; | 		return 1; | ||||||
| 
 | 
 | ||||||
| 	for (p = _PyImport_Inittab; p->name != NULL; p++) { | 	for (p = PyImport_Inittab; p->name != NULL; p++) { | ||||||
| 		if (strcmp(name, p->name) == 0) { | 		if (strcmp(name, p->name) == 0) { | ||||||
| 			if (p->initfunc == NULL) { | 			if (p->initfunc == NULL) { | ||||||
| 				PyErr_Format(PyExc_ImportError, | 				PyErr_Format(PyExc_ImportError, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum