summaryrefslogtreecommitdiff
path: root/Python/codecs.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
committerMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
commitc3eb93fe1ce5f5ff2666fb9f34a6fd7c46279554 (patch)
tree22327341f23de643b9a5232102b03e9bf05b2c06 /Python/codecs.c
parent38c3b0f952599c52b621ee06945432f1af635c16 (diff)
downloadcpython-c3eb93fe1ce5f5ff2666fb9f34a6fd7c46279554.tar.gz
Use identifier API for PyObject_GetAttrString.
Diffstat (limited to 'Python/codecs.c')
-rw-r--r--Python/codecs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index 0008bdcbdc..79dfe89aba 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -465,9 +465,11 @@ PyObject *PyCodec_LookupError(const char *name)
static void wrong_exception_type(PyObject *exc)
{
- PyObject *type = PyObject_GetAttrString(exc, "__class__");
+ _Py_identifier(__class__);
+ _Py_identifier(__name__);
+ PyObject *type = _PyObject_GetAttrId(exc, &PyId___class__);
if (type != NULL) {
- PyObject *name = PyObject_GetAttrString(type, "__name__");
+ PyObject *name = _PyObject_GetAttrId(type, &PyId___name__);
Py_DECREF(type);
if (name != NULL) {
PyErr_Format(PyExc_TypeError,