Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting
  • Loading branch information
Erlend E. Aasland committed Apr 30, 2021
commit 52795a49b2c607be10efca76dfadf686db9f55eb
8 changes: 4 additions & 4 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ check_set_special_type_attr(PyTypeObject *type, PyObject *value, const char *nam
{
if (_PyType_HasFeature(type, Py_TPFLAGS_IMMUTABLETYPE)) {
PyErr_Format(PyExc_TypeError,
"cannot set '%r' attribute of immutable type '%s'",
"cannot set '%R' attribute of immutable type '%s'",
name, type->tp_name);
return 0;
}
if (!value) {
PyErr_Format(PyExc_TypeError,
"cannot delete '%r' attribute of immutable type '%s'",
"cannot delete '%R' attribute of immutable type '%s'",
name, type->tp_name);
return 0;
}
Expand Down Expand Up @@ -3951,8 +3951,8 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
if (type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) {
PyErr_Format(
PyExc_TypeError,
"cannot set attributes of immutable type '%s'",
type->tp_name);
"cannot set '%R' attribute of immutable type '%s'",
Comment thread
vstinner marked this conversation as resolved.
Outdated
name, type->tp_name);
return -1;
}
if (PyUnicode_Check(name)) {
Expand Down