Author: Armin Rigo <[email protected]>
Branch: use-gc-del-3
Changeset: r84253:6f05a5828b98
Date: 2016-05-06 09:57 +0200
http://bitbucket.org/pypy/pypy/changeset/6f05a5828b98/
Log: Fix select
diff --git a/pypy/module/select/interp_epoll.py
b/pypy/module/select/interp_epoll.py
--- a/pypy/module/select/interp_epoll.py
+++ b/pypy/module/select/interp_epoll.py
@@ -76,6 +76,7 @@
class W_Epoll(W_Root):
def __init__(self, space, epfd):
self.epfd = epfd
+ self.register_finalizer(space)
@unwrap_spec(sizehint=int)
def descr__new__(space, w_subtype, sizehint=-1):
@@ -94,7 +95,7 @@
def descr_fromfd(space, w_cls, fd):
return space.wrap(W_Epoll(space, fd))
- def __del__(self):
+ def _finalize_(self):
self.close()
def check_closed(self, space):
diff --git a/pypy/module/select/interp_kqueue.py
b/pypy/module/select/interp_kqueue.py
--- a/pypy/module/select/interp_kqueue.py
+++ b/pypy/module/select/interp_kqueue.py
@@ -109,6 +109,7 @@
class W_Kqueue(W_Root):
def __init__(self, space, kqfd):
self.kqfd = kqfd
+ self.register_finalizer(space)
def descr__new__(space, w_subtype):
kqfd = syscall_kqueue()
@@ -120,7 +121,7 @@
def descr_fromfd(space, w_cls, fd):
return space.wrap(W_Kqueue(space, fd))
- def __del__(self):
+ def _finalize_(self):
self.close()
def get_closed(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit