File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1125,15 +1125,16 @@ static PyMemberDef type_members[] = {
11251125static int
11261126check_set_special_type_attr (PyTypeObject * type , PyObject * value , const char * name )
11271127{
1128- if (_PyType_HasFeature (type , Py_TPFLAGS_IMMUTABLETYPE )) {
1128+
1129+ if (!value ) {
11291130 PyErr_Format (PyExc_TypeError ,
1130- "cannot set '%s' attribute of immutable type '%s'" ,
1131+ "cannot delete '%s' attribute of type '%s'" ,
11311132 name , type -> tp_name );
11321133 return 0 ;
11331134 }
1134- if (! value ) {
1135+ if (_PyType_HasFeature ( type , Py_TPFLAGS_IMMUTABLETYPE ) ) {
11351136 PyErr_Format (PyExc_TypeError ,
1136- "cannot delete '%s' attribute of immutable type '%s'" ,
1137+ "cannot set '%s' attribute of immutable type '%s'" ,
11371138 name , type -> tp_name );
11381139 return 0 ;
11391140 }
You can’t perform that action at this time.
0 commit comments