[pypy-svn] pypy default: Fix select tests.

alex_gaynor commits-noreply at bitbucket.org
Wed Jan 19 17:26:46 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r40938:0ecd295fde29
Date: 2011-01-19 10:07 -0600
http://bitbucket.org/pypy/pypy/changeset/0ecd295fde29/

Log:	Fix select tests.

diff --git a/pypy/module/select/test/test_select.py b/pypy/module/select/test/test_select.py
--- a/pypy/module/select/test/test_select.py
+++ b/pypy/module/select/test/test_select.py
@@ -228,8 +228,8 @@
         space = gettestobjspace(usemodules=('select',))
         cls.space = space
 
+    def w_getpair(self):
         # Wraps a file descriptor in an socket-like object
-        cls.w_getpair = space.appexec([], '''():
         import os
         class FileAsSocket:
             def __init__(self, fd):
@@ -242,10 +242,8 @@
                 return os.read(self.fd, length)
             def close(self):
                 return os.close(self.fd)
-        def getpair():
-            s1, s2 = os.pipe()
-            return FileAsSocket(s1), FileAsSocket(s2)
-        return getpair''')
+        s1, s2 = os.pipe()
+        return FileAsSocket(s1), FileAsSocket(s2)
 
 class AppTestSelectWithSockets(_AppTestSelect):
     """Same tests with connected sockets.


More information about the Pypy-commit mailing list