Maciej Fijalkowski  committed d8f5b33

don't call close on socket, instead almost copy the logic. The idea is that
we should not raise from an RPython level __del__

  • Participants
  • Parent commits ef34d4c
  • Branches lightweight-finalizers

Comments (0)

Files changed (1)

File pypy/rlib/

         self.timeout = defaults.timeout
     def __del__(self):
-        self.close()
+        fd = self.fd
+        if fd != _c.INVALID_SOCKET:
+            self.fd = _c.INVALID_SOCKET
+            _c.socketclose(fd)
     if hasattr(_c, 'fcntl'):
         def _setblocking(self, block):