diff options
author | Guido van Rossum <guido@python.org> | 1995-08-04 04:05:31 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-08-04 04:05:31 (GMT) |
commit | ac21f6a5797286e97136723a094f5b86070cde55 (patch) | |
tree | afaf7295aea68cae4f47bbc77db2c22bf41a5146 /Objects/classobject.c | |
parent | 055968c06844498fc4e8e6bdefe737828b8525ca (diff) | |
download | cpython-ac21f6a5797286e97136723a094f5b86070cde55.zip cpython-ac21f6a5797286e97136723a094f5b86070cde55.tar.gz cpython-ac21f6a5797286e97136723a094f5b86070cde55.tar.bz2 |
class objects are read-only in restricted mode
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index d4a873f6..0d0a109 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -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); |