diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 47abe8d..50cfe29 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4175,7 +4175,7 @@ sock_dealloc(PySocketSockObject *s)
         ++Py_REFCNT(s);
         PyErr_Fetch(&exc, &val, &tb);
         if (PyErr_WarnFormat(PyExc_ResourceWarning, 1,
-                             "unclosed %R", s))
+                             "unclosed socket"))
             /* Spurious errors can appear at shutdown */
             if (PyErr_ExceptionMatches(PyExc_Warning))
                 PyErr_WriteUnraisable((PyObject *) s);