Commit 0ee11fe8 authored by Guido van Rossum's avatar Guido van Rossum

class objects are read-only in restricted mode

parent bb7ebecf
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment