Ralf Schmitt committed 1750d2f

create a pipe instead of select'ing on sys.stdin in

this makes compatible with py.test and makes it
possible to run with stdin redirected.

Comments (0)

Files changed (1)


 import sys
+import os
 from gevent import select, socket
 import greentest
     class TestSelectRead(greentest.GenericWaitTestCase):
         def wait(self, timeout):
-  [sys.stdin.fileno()], [], [], timeout)
+            r, w = os.pipe()
+            try:
+      [r], [], [], timeout)
+            finally:
+                os.close(r)
+                os.close(w)
 class TestSelectTypes(greentest.TestCase):