Skip to content

Commit 2ca926d

Browse files
committed
Update news entry
1 parent 543c20b commit 2ca926d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Misc/NEWS.d/next/Core_and_Builtins/2025-06-24-00-21-27.gh-issue-107545.GDa7Zs.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Improve the error messages that may be raised by
2+
:meth:`~socket.socket.setsockopt`

Modules/socketmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,8 +3355,8 @@ sock_setsockopt(PyObject *self, PyObject *args)
33553355
}
33563356
if (arglen == 4 && optval != Py_None) {
33573357
PyErr_Format(PyExc_TypeError,
3358-
"setsockopt() argument 3 must be NoneType, not %s",
3359-
Py_TYPE(optval)->tp_name);
3358+
"setsockopt() argument 3 must be NoneType, not %T",
3359+
optval);
33603360
return NULL;
33613361
}
33623362

@@ -3426,8 +3426,8 @@ sock_setsockopt(PyObject *self, PyObject *args)
34263426
}
34273427

34283428
PyErr_Format(PyExc_TypeError,
3429-
"socket option should be int, bytes-like object or None (got %s)",
3430-
Py_TYPE(optval)->tp_name);
3429+
"socket option should be int, bytes-like object or None (got %T)",
3430+
optval);
34313431
return NULL;
34323432

34333433
done:

0 commit comments

Comments
 (0)