Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 89f2aaa..9116d9f 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1467,8 +1467,7 @@
         return -1;
 #else
         Py_INCREF(value);
-        Py_DECREF(self->ctx);
-        self->ctx = (PySSLContext *) value;
+        Py_SETREF(self->ctx, (PySSLContext *)value);
         SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
 #endif
     } else {