Author: Zsolt Cserna <[email protected]>
Branch: py3.6-socket-fix
Changeset: r96974:cb0f4d2e2faf
Date: 2019-07-13 11:52 +0200
http://bitbucket.org/pypy/pypy/changeset/cb0f4d2e2faf/

Log:    fix AppTestSocket.().test_invalid_fd

        Rename the kwarg from fdobj to fileno. fdobj comes from the C
        implementation of _socket in cpython but the test specifies it by
        keyword so it needs to be changed accordingly.

diff --git a/pypy/module/_socket/interp_socket.py 
b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -198,16 +198,16 @@
             self.register_finalizer(space)
 
     @unwrap_spec(family=int, type=int, proto=int,
-                 w_fdobj=WrappedDefault(None))
+                 w_fileno=WrappedDefault(None))
     def descr_init(self, space, family=AF_INET, type=SOCK_STREAM, proto=0,
-                   w_fdobj=None):
+                   w_fileno=None):
         try:
-            if not space.is_w(w_fdobj, space.w_None):
-                if _WIN32 and space.isinstance_w(w_fdobj, space.w_bytes):
+            if not space.is_w(w_fileno, space.w_None):
+                if _WIN32 and space.isinstance_w(w_fileno, space.w_bytes):
                     from rpython.rlib.rsocket import _c
                     # it is possible to pass some bytes representing a socket
                     # in the file descriptor object on winodws
-                    fdobj = space.bytes_w(w_fdobj)
+                    fdobj = space.bytes_w(w_fileno)
                     info_charptr = rffi.str2charp(fdobj)
                     try:
                         info_ptr = rffi.cast(lltype.Ptr(_c.WSAPROTOCOL_INFOW), 
info_charptr)
@@ -220,7 +220,7 @@
                         lltype.free(info_charptr, flavor='raw')
                 else:
                     sock = RSocket(family, type, proto,
-                                   fd=space.c_filedescriptor_w(w_fdobj))
+                                   fd=space.c_filedescriptor_w(w_fileno))
             else:
                 sock = RSocket(family, type, proto, inheritable=False)
             W_Socket.__init__(self, space, sock)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to