Skip to content
Merged
Prev Previous commit
Next Next commit
bpo-46730: Change preposition from "in" to "of" in error
  • Loading branch information
Alexander Lakeev
Alexander Lakeev committed Feb 14, 2022
commit 759427709ae8db023400aa9baafa6ec9c784ede3
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' in object of type 'PropertyUnreachableAttributeWithName\.cls' {}$"
msg_format = r"^property 'foo' of object of type 'PropertyUnreachableAttributeWithName\.cls' {}$"

class cls:
foo = property()


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

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 in object of type %R has no getter",
"property %R of object of type %R has no getter",
gs->prop_name,
PyType_GetQualName(Py_TYPE(obj)));
}
else {
PyErr_Format(PyExc_AttributeError,
"property in object of type %R has no getter",
"property of object of type %R 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 in object of type %R has no deleter" :
"property %R in object of type %R has no setter",
"property %R of object of type %R has no deleter" :
"property %R of object of type %R has no setter",
gs->prop_name,
PyType_GetQualName(Py_TYPE(obj)));
}
else if (obj != NULL) {
PyErr_Format(PyExc_AttributeError,
value == NULL ?
"property in object of type %R has no deleter" :
"property in object of type %R has no setter",
"property of object of type %R has no deleter" :
"property of object of type %R has no setter",
PyType_GetQualName(Py_TYPE(obj)));
}
else {
Expand Down