@@ -6457,14 +6457,17 @@ Convert a 32-bit integer from host to network byte order.");
6457
6457
6458
6458
/* socket.inet_aton() and socket.inet_ntoa() functions. */
6459
6459
6460
- PyDoc_STRVAR (inet_aton_doc ,
6461
- "inet_aton(string) -> bytes giving packed 32-bit IP representation\n\
6462
- \n\
6463
- Convert an IP address in string format (123.45.67.89) to the 32-bit packed\n\
6464
- binary format used in low-level network functions." );
6460
+ /*[clinic input]
6461
+ _socket.socket.inet_aton
6462
+ ip_addr: str
6463
+ /
6465
6464
6466
- static PyObject *
6467
- socket_inet_aton (PyObject * self , PyObject * args )
6465
+ Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions.
6466
+ [clinic start generated code]*/
6467
+
6468
+ static PyObject *
6469
+ _socket_socket_inet_aton_impl (PySocketSockObject * self , const char * ip_addr )
6470
+ /*[clinic end generated code: output=5bfe11a255423d8c input=a120e20cb52b9488]*/
6468
6471
{
6469
6472
#ifdef HAVE_INET_ATON
6470
6473
struct in_addr buf ;
@@ -6477,11 +6480,6 @@ socket_inet_aton(PyObject *self, PyObject *args)
6477
6480
/* Have to use inet_addr() instead */
6478
6481
unsigned int packed_addr ;
6479
6482
#endif
6480
- const char * ip_addr ;
6481
-
6482
- if (!PyArg_ParseTuple (args , "s:inet_aton" , & ip_addr ))
6483
- return NULL ;
6484
-
6485
6483
6486
6484
#ifdef HAVE_INET_ATON
6487
6485
@@ -7219,8 +7217,7 @@ static PyMethodDef socket_methods[] = {
7219
7217
_SOCKET_SOCKET_HTONS_METHODDEF
7220
7218
{"htonl" , socket_htonl ,
7221
7219
METH_O , htonl_doc },
7222
- {"inet_aton" , socket_inet_aton ,
7223
- METH_VARARGS , inet_aton_doc },
7220
+ _SOCKET_SOCKET_INET_ATON_METHODDEF
7224
7221
#ifdef HAVE_INET_NTOA
7225
7222
{"inet_ntoa ", socket_inet_ntoa ,
7226
7223
METH_VARARGS , inet_ntoa_doc },
0 commit comments