Skip to content
Merged
Prev Previous commit
Next Next commit
bpo-46730: Change the order of words
  • Loading branch information
Alexander Lakeev
Alexander Lakeev committed Feb 15, 2022
commit 3d931a171136189f8f9d28898eecc669d2a6720e
4 changes: 2 additions & 2 deletions Lib/test/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,14 @@ def test_del_property(self):


class PropertyUnreachableAttributeWithName(_PropertyUnreachableAttribute, unittest.TestCase):
msg_format = r"^property 'foo' of object 'PropertyUnreachableAttributeWithName\.cls' {}$"
msg_format = r"^property 'foo' of 'PropertyUnreachableAttributeWithName\.cls' object {}$"

class cls:
foo = property()


class PropertyUnreachableAttributeNoName(_PropertyUnreachableAttribute, unittest.TestCase):
msg_format = "^property of object 'PropertyUnreachableAttributeNoName\.cls' {}$"
msg_format = "^property of 'PropertyUnreachableAttributeNoName\.cls' object {}$"

class cls:
pass
Expand Down
12 changes: 6 additions & 6 deletions Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,13 +1587,13 @@ property_descr_get(PyObject *self, PyObject *obj, PyObject *type)
if (gs->prop_get == NULL) {
if (gs->prop_name != NULL) {
PyErr_Format(PyExc_AttributeError,
"property %R of object %R has no getter",
"property %R of %R object has no getter",
gs->prop_name,
PyType_GetQualName(Py_TYPE(obj)));
}
else {
PyErr_Format(PyExc_AttributeError,
"property of object %R has no getter",
"property of %R object has no getter",
PyType_GetQualName(Py_TYPE(obj)));
}

Expand All @@ -1620,16 +1620,16 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
if (gs->prop_name != NULL && obj != NULL) {
PyErr_Format(PyExc_AttributeError,
value == NULL ?
"property %R of object %R has no deleter" :
"property %R of object %R has no setter",
"property %R of %R object has no deleter" :
"property %R of %R object has no setter",
gs->prop_name,
PyType_GetQualName(Py_TYPE(obj)));
}
else if (obj != NULL) {
PyErr_Format(PyExc_AttributeError,
value == NULL ?
"property of object %R has no deleter" :
"property of object %R has no setter",
"property of %R object has no deleter" :
"property of %R object has no setter",
PyType_GetQualName(Py_TYPE(obj)));
}
else {
Expand Down