Author: Maciej Fijalkowski <[email protected]>
Branch: lightweight-finalizers
Changeset: r47885:d8f5b3366786
Date: 2011-10-09 01:32 +0200
http://bitbucket.org/pypy/pypy/changeset/d8f5b3366786/

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

diff --git a/pypy/rlib/rsocket.py b/pypy/rlib/rsocket.py
--- a/pypy/rlib/rsocket.py
+++ b/pypy/rlib/rsocket.py
@@ -610,7 +610,10 @@
         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):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to