From: Guido van Rossum Date: Tue, 18 Feb 2003 17:18:35 +0000 (+0000) Subject: Make __module__ writable except in restricted mode (like for classic classes). X-Git-Tag: v2.3c1~1796 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b29c0147b964e6afa6a09bb8d694bafc30cf7ad;p=thirdparty%2FPython%2Fcpython.git Make __module__ writable except in restricted mode (like for classic classes). --- diff --git a/Objects/funcobject.c b/Objects/funcobject.c index fa241312c2bf..6f0fa2685629 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -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 */ }; diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 5e967d3f3dba..3a92fa45ce33 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -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} };