summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-06-14 04:18:03 (GMT)
committerGitHub <noreply@github.com>2022-06-14 04:18:03 (GMT)
commit8352e322e87ba39c71e578b65ad8ae156ca3e0c7 (patch)
tree7a6923191a141b09b624a2f20dee35a5595d4223 /Objects
parent6fd4c8ec7740523bb81191c013118d9d6959bc9d (diff)
downloadcpython-8352e322e87ba39c71e578b65ad8ae156ca3e0c7.zip
cpython-8352e322e87ba39c71e578b65ad8ae156ca3e0c7.tar.gz
cpython-8352e322e87ba39c71e578b65ad8ae156ca3e0c7.tar.bz2
gh-79512: Fixed names and __module__ value of weakref classes (GH-93719)
Classes ReferenceType, ProxyType and CallableProxyType have now correct atrtributes __module__, __name__ and __qualname__. It makes them (types, not instances) pickleable.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/weakrefobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index 1712533..2b4361e 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -371,7 +371,7 @@ static PyMethodDef weakref_methods[] = {
PyTypeObject
_PyWeakref_RefType = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- .tp_name = "weakref",
+ .tp_name = "weakref.ReferenceType",
.tp_basicsize = sizeof(PyWeakReference),
.tp_dealloc = weakref_dealloc,
.tp_vectorcall_offset = offsetof(PyWeakReference, vectorcall),
@@ -719,7 +719,7 @@ static PyMappingMethods proxy_as_mapping = {
PyTypeObject
_PyWeakref_ProxyType = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "weakproxy",
+ "weakref.ProxyType",
sizeof(PyWeakReference),
0,
/* methods */
@@ -754,7 +754,7 @@ _PyWeakref_ProxyType = {
PyTypeObject
_PyWeakref_CallableProxyType = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "weakcallableproxy",
+ "weakref.CallableProxyType",
sizeof(PyWeakReference),
0,
/* methods */