Skip to content

Commit 42522c0

Browse files
committed
Use %R for quoting strings
1 parent f28f1d5 commit 42522c0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Objects/exceptions.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,18 +2743,18 @@ AttributeError_str(PyObject *op)
27432743
goto done;
27442744
}
27452745
if (modname && PyUnicode_Check(modname)) {
2746-
result = PyUnicode_FromFormat("module '%U' has no attribute '%U'",
2746+
result = PyUnicode_FromFormat("module %R has no attribute %R",
27472747
modname, name);
27482748
Py_DECREF(modname);
27492749
} else {
27502750
Py_XDECREF(modname);
2751-
result = PyUnicode_FromFormat("module has no attribute '%U'", name);
2751+
result = PyUnicode_FromFormat("module has no attribute %R", name);
27522752
}
27532753
} else if (PyType_Check(obj)) {
2754-
result = PyUnicode_FromFormat("type object '%N' has no attribute '%U'",
2754+
result = PyUnicode_FromFormat("type object '%N' has no attribute %R",
27552755
obj, name);
27562756
} else {
2757-
result = PyUnicode_FromFormat("'%T' object has no attribute '%U'",
2757+
result = PyUnicode_FromFormat("'%T' object has no attribute %R",
27582758
obj, name);
27592759
}
27602760
done:

0 commit comments

Comments
 (0)