class objects are read-only in restricted mode

This commit is contained in:
Guido van Rossum 1995-08-04 04:05:31 +00:00
parent 055968c068
commit ac21f6a579
1 changed files with 5 additions and 0 deletions

View File

@ -174,6 +174,11 @@ class_setattr(op, name, v)
return -1;
}
}
if (getrestricted()) {
err_setstr(RuntimeError,
"classes are read-only in restricted mode");
return -1;
}
ac = dictlookup(op->cl_dict, name);
if (ac != NULL && is_accessobject(ac))
return setaccessvalue(ac, getowner(), v);