mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	bpo-1635741: _contextvars uses PyModule_AddType() (GH-23147)
Replace PyModule_AddObject() with PyModule_AddType() in the _contextvars module (Python-ast.c). Add also the module name to _contextvars types name.
This commit is contained in:
		
							parent
							
								
									cfb41e80c1
								
							
						
					
					
						commit
						988f1ec8d2
					
				
					 2 changed files with 6 additions and 21 deletions
				
			
		|  | @ -703,7 +703,7 @@ static PyMappingMethods PyContext_as_mapping = { | |||
| 
 | ||||
| PyTypeObject PyContext_Type = { | ||||
|     PyVarObject_HEAD_INIT(&PyType_Type, 0) | ||||
|     "Context", | ||||
|     "_contextvars.Context", | ||||
|     sizeof(PyContext), | ||||
|     .tp_methods = PyContext_methods, | ||||
|     .tp_as_mapping = &PyContext_as_mapping, | ||||
|  | @ -1056,7 +1056,7 @@ static PyMethodDef PyContextVar_methods[] = { | |||
| 
 | ||||
| PyTypeObject PyContextVar_Type = { | ||||
|     PyVarObject_HEAD_INIT(&PyType_Type, 0) | ||||
|     "ContextVar", | ||||
|     "_contextvars.ContextVar", | ||||
|     sizeof(PyContextVar), | ||||
|     .tp_methods = PyContextVar_methods, | ||||
|     .tp_members = PyContextVar_members, | ||||
|  | @ -1197,7 +1197,7 @@ static PyMethodDef PyContextTokenType_methods[] = { | |||
| 
 | ||||
| PyTypeObject PyContextToken_Type = { | ||||
|     PyVarObject_HEAD_INIT(&PyType_Type, 0) | ||||
|     "Token", | ||||
|     "_contextvars.Token", | ||||
|     sizeof(PyContextToken), | ||||
|     .tp_methods = PyContextTokenType_methods, | ||||
|     .tp_getset = PyContextTokenType_getsetlist, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner