https://github.com/python/cpython/commit/03a3f3d30cab2752e8ed84a47d64afee88d13fd9
commit: 03a3f3d30cab2752e8ed84a47d64afee88d13fd9
branch: main
author: Lazizbek Ergashev <[email protected]>
committer: benjaminp <[email protected]>
date: 2026-10-18T04:12:51Z
summary:
fixes gh-159561: Remove redundant type check in AF_VSOCK setsockopt() (#159610)
files:
M Modules/socketmodule.c
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 5fec77a2b82bf7..21a00a31201d9f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3420,11 +3420,6 @@ sock_setsockopt(PyObject *self, PyObject *args)
#ifdef AF_VSOCK
if (s->sock_family == AF_VSOCK) {
- if (!PyIndex_Check(optval)) {
- PyErr_Format(PyExc_TypeError,
- "setsockopt() argument 3 for AF_VSOCK must be an int
(got %T)",
- optval);
- }
uint64_t vflag; // Must be set width of 64 bits
/* setsockopt(level, opt, flag) */
if (!PyArg_Parse(optval, "K", &vflag)) {
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]