diff Python/codecs.c @ 72848:81380082d216

Use identifier API for PyObject_GetAttrString.
author Martin v. Löwis <martin@v.loewis.de>
date Mon, 10 Oct 2011 18:11:30 +0200
parents 611c57aa694a
children d76338eacf7c
line wrap: on
line diff
--- a/Python/codecs.c	Mon Oct 10 03:21:36 2011 +0200
+++ b/Python/codecs.c	Mon Oct 10 18:11:30 2011 +0200
@@ -465,9 +465,11 @@
 
 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,