Commits

Philip Jenvey committed 65f3a63

stub out a method for emitting warnings on implicit closing by __del__

Comments (0)

Files changed (1)

rpython/rlib/rsocket.py

     def __del__(self):
         fd = self.fd
         if fd != _c.INVALID_SOCKET:
-            self.fd = _c.INVALID_SOCKET
-            _c.socketclose(fd)
+            try:
+                self._dealloc_warn()
+            finally:
+                self.fd = _c.INVALID_SOCKET
+                _c.socketclose(fd)
+
+    def _dealloc_warn(self):
+        """Called when implicitly closed via the deconstructor"""
+        pass
 
     if hasattr(_c, 'fcntl'):
         def _setblocking(self, block):