summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-07-12 15:22:26 (GMT)
committerBrett Cannon <brett@python.org>2013-07-12 15:22:26 (GMT)
commita79e4fb38d6e598be56944ead5753e65ad561bab (patch)
treef3a0f201b80165802e325096d8535c5b9eb0083b /Python/ceval.c
parentf0cb69274c735ae5d178acf4bfe7e314b046eb57 (diff)
downloadcpython-a79e4fb38d6e598be56944ead5753e65ad561bab.zip
cpython-a79e4fb38d6e598be56944ead5753e65ad561bab.tar.gz
cpython-a79e4fb38d6e598be56944ead5753e65ad561bab.tar.bz2
Issue #18342: Use the repr of a module name for ``from ... import
...`` when an ImportError occurs. Other cases had already been switched over to using the repr. Thanks to Tomasz Maćkowiak for the patch.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index a53e377..61928e3 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4602,7 +4602,7 @@ import_from(PyObject *v, PyObject *name)
x = PyObject_GetAttr(v, name);
if (x == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
+ PyErr_Format(PyExc_ImportError, "cannot import name %R", name);
}
return x;
}