bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119)
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index e18dd32..bf8d19f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5972,12 +5972,14 @@
"getnameinfo() argument 1 must be a tuple");
return NULL;
}
- if (!PyArg_ParseTuple(sa, "si|II",
+ if (!PyArg_ParseTuple(sa, "si|II;getnameinfo(): illegal sockaddr argument",
&hostp, &port, &flowinfo, &scope_id))
+ {
return NULL;
+ }
if (flowinfo > 0xfffff) {
PyErr_SetString(PyExc_OverflowError,
- "getsockaddrarg: flowinfo must be 0-1048575.");
+ "getnameinfo(): flowinfo must be 0-1048575.");
return NULL;
}
PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port);