Skip to content

Commit a88d715

Browse files
committed
Move comment up, use %R in the error message
1 parent 0f43042 commit a88d715

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Objects/lazyimportobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ lazy_import_dealloc(PyObject *op)
8181
Py_TYPE(op)->tp_free(op);
8282
}
8383

84+
/* Specialize the error message for failed attribute lookups. */
8485
static PyObject *
8586
lazy_import_getattro(PyObject *op, PyObject *name) {
86-
/* Suppress to override the error message. */
8787
PyObject *value = _PyObject_GenericGetAttrWithDict(op, name, NULL, /* suppress */1);
8888
if (value == NULL) {
8989
if (PyErr_Occurred()) {
@@ -94,7 +94,7 @@ lazy_import_getattro(PyObject *op, PyObject *name) {
9494
return NULL;
9595
}
9696
PyErr_Format(PyExc_AttributeError,
97-
"cannot access attribute '%U' on unresolved lazy import '%U'",
97+
"cannot access attribute %R on unresolved lazy import %R",
9898
name, lz_name);
9999
Py_DECREF(lz_name);
100100
return NULL;

0 commit comments

Comments
 (0)