diff options
author | Victor Stinner <vstinner@python.org> | 2020-11-04 15:33:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 15:33:55 (GMT) |
commit | 988f1ec8d2643a0d00851903abcdae90d57ac0e6 (patch) | |
tree | a1cd6775adef2af21bcdfd29d140af1c80ff38fc /Python/context.c | |
parent | cfb41e80c1ac5940ec6f2246c9ab4a3d16ef757e (diff) | |
download | cpython-988f1ec8d2643a0d00851903abcdae90d57ac0e6.zip cpython-988f1ec8d2643a0d00851903abcdae90d57ac0e6.tar.gz cpython-988f1ec8d2643a0d00851903abcdae90d57ac0e6.tar.bz2 |
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.
Diffstat (limited to 'Python/context.c')
-rw-r--r-- | Python/context.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/context.c b/Python/context.c index 15d8b8e..82826bf 100644 --- a/Python/context.c +++ b/Python/context.c @@ -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, |