[pypy-commit] pypy default: Test and fix for Issue 1338: Don't raise an error when closing an epoll fd twice.

Manuel Jacob noreply at buildbot.pypy.org
Thu Nov 29 16:33:05 CET 2012


Author: Manuel Jacob
Branch: 
Changeset: r59124:9e389d386a5a
Date: 2012-11-29 16:11 +0100
http://bitbucket.org/pypy/pypy/changeset/9e389d386a5a/

Log:	Test and fix for Issue 1338: Don't raise an error when closing an
	epoll fd twice.

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
@@ -128,7 +128,6 @@
         return space.wrap(self.epfd)
 
     def descr_close(self, space):
-        self.check_closed(space)
         self.close()
 
     @unwrap_spec(eventmask=int)
diff --git a/pypy/module/select/test/test_epoll.py b/pypy/module/select/test/test_epoll.py
--- a/pypy/module/select/test/test_epoll.py
+++ b/pypy/module/select/test/test_epoll.py
@@ -195,3 +195,10 @@
 
         server.close()
         ep.unregister(fd)
+
+    def test_close_twice(self):
+        import select
+
+        ep = select.epoll()
+        ep.close()
+        ep.close()


More information about the pypy-commit mailing list