Commits

Philip Jenvey committed bb1736d

cleanup destruction now that we're fully responsible for it

Comments (0)

Files changed (1)

pypy/module/_socket/interp_socket.py

 
     def destructor(self):
         assert isinstance(self, W_RSocket)
-        RSocket.__del__(self)
+        if self.fd != rsocket.INVALID_SOCKET:
+            try:
+                self._dealloc_warn()
+            finally:
+                self.close_w(self.space)
 
     def _dealloc_warn(self):
         space = self.space
-        if not space:
-            return
         try:
             msg = (u"unclosed %s" %
                    space.unicode_w(space.repr(space.wrap(self))))