Armin Rigo  committed c301859

Fix for tests: add _reuse and _drop methods in mock low-level socket objects

  • Participants
  • Parent commits 1636814

Comments (0)

Files changed (3)

File lib-python/2.7/test/

         def recv(self, size):
+        def _reuse(self): pass
+        def _drop(self): pass
     def _raise_eintr():
         raise socket.error(errno.EINTR)
             closed = False
             def flush(self): pass
             def close(self): self.closed = True
-            def _decref_socketios(self): pass
+            def _reuse(self): pass
+            def _drop(self): pass
         # must not close unless we request it: the original use of _fileobject
         # by module socket requires that the underlying socket not be closed until

File lib-python/2.7/test/

         self.reason = reason
     def read(self):
         return ''
+    def _reuse(self): pass
+    def _drop(self): pass
 class MockHTTPClass:
     def __init__(self):

File lib-python/2.7/

         # out of socket._fileobject() and into a base class.
         r.recv =
+        r._reuse = lambda: None
+        r._drop = lambda: None
         fp = socket._fileobject(r, close=True)
         resp = addinfourl(fp, r.msg, req.get_full_url())