mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Make __module__ writable except in restricted mode (like for classic classes).
This commit is contained in:
parent
ff71c98449
commit
6b29c0147b
2 changed files with 2 additions and 2 deletions
|
@ -159,7 +159,7 @@ static PyMemberDef func_memberlist[] = {
|
|||
RESTRICTED|READONLY},
|
||||
{"func_name", T_OBJECT, OFF(func_name), READONLY},
|
||||
{"__name__", T_OBJECT, OFF(func_name), READONLY},
|
||||
{"__module__", T_OBJECT, OFF(func_module)},
|
||||
{"__module__", T_OBJECT, OFF(func_module), WRITE_RESTRICTED},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ static PyGetSetDef meth_getsets [] = {
|
|||
#define OFF(x) offsetof(PyCFunctionObject, x)
|
||||
|
||||
static PyMemberDef meth_members[] = {
|
||||
{"__module__", T_OBJECT, OFF(m_module)},
|
||||
{"__module__", T_OBJECT, OFF(m_module), WRITE_RESTRICTED},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue