Use identifier API for PyObject_GetAttrString.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 0ef36bb..df0d1b3 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -141,12 +141,13 @@
 {
     char *name_utf8, *name_str;
     PyObject *codec, *name = NULL;
+    _Py_identifier(name);
 
     codec = _PyCodec_Lookup(encoding);
     if (!codec)
         goto error;
 
-    name = PyObject_GetAttrString(codec, "name");
+    name = _PyObject_GetAttrId(codec, &PyId_name);
     Py_CLEAR(codec);
     if (!name)
         goto error;
@@ -830,7 +831,8 @@
         goto error;
 
     if (buffering) {
-        raw = PyObject_GetAttrString(buf, "raw");
+        _Py_identifier(raw);
+        raw = _PyObject_GetAttrId(buf, &PyId_raw);
         if (raw == NULL)
             goto error;
     }
@@ -1115,13 +1117,14 @@
     PyArena *arena;
     char *ps1 = "", *ps2 = "", *enc = NULL;
     int errcode = 0;
+    _Py_identifier(encoding);
 
     if (fp == stdin) {
         /* Fetch encoding from sys.stdin */
         v = PySys_GetObject("stdin");
         if (v == NULL || v == Py_None)
             return -1;
-        oenc = PyObject_GetAttrString(v, "encoding");
+        oenc = _PyObject_GetAttrId(v, &PyId_encoding);
         if (!oenc)
             return -1;
         enc = _PyUnicode_AsString(oenc);
@@ -1318,6 +1321,11 @@
 {
     long hold;
     PyObject *v;
+    _Py_identifier(msg);
+    _Py_identifier(filename);
+    _Py_identifier(lineno);
+    _Py_identifier(offset);
+    _Py_identifier(text);
 
     /* old style errors */
     if (PyTuple_Check(err))
@@ -1326,11 +1334,11 @@
 
     /* new style errors.  `err' is an instance */
 
-    if (! (v = PyObject_GetAttrString(err, "msg")))
+    if (! (v = _PyObject_GetAttrId(err, &PyId_msg)))
         goto finally;
     *message = v;
 
-    if (!(v = PyObject_GetAttrString(err, "filename")))
+    if (!(v = _PyObject_GetAttrId(err, &PyId_filename)))
         goto finally;
     if (v == Py_None)
         *filename = NULL;
@@ -1338,7 +1346,7 @@
         goto finally;
 
     Py_DECREF(v);
-    if (!(v = PyObject_GetAttrString(err, "lineno")))
+    if (!(v = _PyObject_GetAttrId(err, &PyId_lineno)))
         goto finally;
     hold = PyLong_AsLong(v);
     Py_DECREF(v);
@@ -1347,7 +1355,7 @@
         goto finally;
     *lineno = (int)hold;
 
-    if (!(v = PyObject_GetAttrString(err, "offset")))
+    if (!(v = _PyObject_GetAttrId(err, &PyId_offset)))
         goto finally;
     if (v == Py_None) {
         *offset = -1;
@@ -1362,7 +1370,7 @@
         *offset = (int)hold;
     }
 
-    if (!(v = PyObject_GetAttrString(err, "text")))
+    if (!(v = _PyObject_GetAttrId(err, &PyId_text)))
         goto finally;
     if (v == Py_None)
         *text = NULL;
@@ -1431,7 +1439,8 @@
         goto done;
     if (PyExceptionInstance_Check(value)) {
         /* The error code should be in the `code' attribute. */
-        PyObject *code = PyObject_GetAttrString(value, "code");
+        _Py_identifier(code);
+        PyObject *code = _PyObject_GetAttrId(value, &PyId_code);
         if (code) {
             Py_DECREF(value);
             value = code;
@@ -1588,6 +1597,7 @@
     else {
         PyObject* moduleName;
         char* className;
+        _Py_identifier(__module__);
         assert(PyExceptionClass_Check(type));
         className = PyExceptionClass_Name(type);
         if (className != NULL) {
@@ -1596,7 +1606,7 @@
                 className = dot+1;
         }
 
-        moduleName = PyObject_GetAttrString(type, "__module__");
+        moduleName = _PyObject_GetAttrId(type, &PyId___module__);
         if (moduleName == NULL || !PyUnicode_Check(moduleName))
         {
             Py_XDECREF(moduleName);