Issue #22570: Renamed Py_SETREF to Py_XSETREF.
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 85f9472..d03aada 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -206,7 +206,7 @@
     seq = PySequence_Tuple(val);
     if (!seq)
         return -1;
-    Py_SETREF(self->args, seq);
+    Py_XSETREF(self->args, seq);
     return 0;
 }
 
@@ -235,7 +235,7 @@
     }
 
     Py_XINCREF(tb);
-    Py_SETREF(self->traceback, tb);
+    Py_XSETREF(self->traceback, tb);
     return 0;
 }
 
@@ -563,11 +563,11 @@
         return 0;
     if (size == 1) {
         Py_INCREF(PyTuple_GET_ITEM(args, 0));
-        Py_SETREF(self->code, PyTuple_GET_ITEM(args, 0));
+        Py_XSETREF(self->code, PyTuple_GET_ITEM(args, 0));
     }
     else { /* size > 1 */
         Py_INCREF(args);
-        Py_SETREF(self->code, args);
+        Py_XSETREF(self->code, args);
     }
     return 0;
 }
@@ -628,7 +628,7 @@
     kwd = PyDict_GetItemString(kwds, #kwd); \
     if (kwd) { \
         Py_INCREF(kwd); \
-        Py_SETREF(self->kwd, kwd); \
+        Py_XSETREF(self->kwd, kwd); \
         if (PyDict_DelItemString(kwds, #kwd)) \
             return -1; \
     } \
@@ -647,7 +647,7 @@
         return -1;
 
     Py_INCREF(msg);
-    Py_SETREF(self->msg, msg);
+    Py_XSETREF(self->msg, msg);
 
     return 0;
 }
@@ -857,7 +857,7 @@
 #endif
 
     /* Steals the reference to args */
-    Py_SETREF(self->args, args);
+    Py_XSETREF(self->args, args);
     *p_args = args = NULL;
 
     return 0;
@@ -1277,7 +1277,7 @@
 
     if (lenargs >= 1) {
         Py_INCREF(PyTuple_GET_ITEM(args, 0));
-        Py_SETREF(self->msg, PyTuple_GET_ITEM(args, 0));
+        Py_XSETREF(self->msg, PyTuple_GET_ITEM(args, 0));
     }
     if (lenargs == 2) {
         info = PyTuple_GET_ITEM(args, 1);
@@ -1293,16 +1293,16 @@
         }
 
         Py_INCREF(PyTuple_GET_ITEM(info, 0));
-        Py_SETREF(self->filename, PyTuple_GET_ITEM(info, 0));
+        Py_XSETREF(self->filename, PyTuple_GET_ITEM(info, 0));
 
         Py_INCREF(PyTuple_GET_ITEM(info, 1));
-        Py_SETREF(self->lineno, PyTuple_GET_ITEM(info, 1));
+        Py_XSETREF(self->lineno, PyTuple_GET_ITEM(info, 1));
 
         Py_INCREF(PyTuple_GET_ITEM(info, 2));
-        Py_SETREF(self->offset, PyTuple_GET_ITEM(info, 2));
+        Py_XSETREF(self->offset, PyTuple_GET_ITEM(info, 2));
 
         Py_INCREF(PyTuple_GET_ITEM(info, 3));
-        Py_SETREF(self->text, PyTuple_GET_ITEM(info, 3));
+        Py_XSETREF(self->text, PyTuple_GET_ITEM(info, 3));
 
         Py_DECREF(info);
 
@@ -1547,7 +1547,7 @@
     PyObject *obj = PyUnicode_FromString(value);
     if (!obj)
         return -1;
-    Py_SETREF(*attr, obj);
+    Py_XSETREF(*attr, obj);
     return 0;
 }
 
@@ -1953,7 +1953,7 @@
         Py_buffer view;
         if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0)
             goto error;
-        Py_SETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len));
+        Py_XSETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len));
         PyBuffer_Release(&view);
         if (!ude->object)
             goto error;
@@ -2862,7 +2862,7 @@
     }
     if (PyUnicode_Tailmatch(self->text, print_prefix,
                             start, text_len, -1)) {
-        Py_SETREF(self->msg,
+        Py_XSETREF(self->msg,
                   PyUnicode_FromString("Missing parentheses in call to 'print'"));
         return 1;
     }
@@ -2876,7 +2876,7 @@
     }
     if (PyUnicode_Tailmatch(self->text, exec_prefix,
                             start, text_len, -1)) {
-        Py_SETREF(self->msg,
+        Py_XSETREF(self->msg,
                   PyUnicode_FromString("Missing parentheses in call to 'exec'"));
         return 1;
     }