Commits

Brian Kearns committed 200fdf5

document this test's workaround better based on mattip's analysis

Comments (0)

Files changed (3)

pypy/module/__pypy__/test/test_signal.py

             __pypy__.thread._signals_enter()
 
     def test_enable_signals(self):
-        import __pypy__, thread, signal, time
+        import __pypy__, thread, signal, time, sys
 
         def subthread():
             try:
         # This is normally called by app_main.py
         signal.signal(signal.SIGINT, signal.default_int_handler)
 
+        if sys.platform.startswith('win'):
+            # Windows seems to hang on _setmode when the first print comes from
+            # a thread, so make sure we've initialized io
+            sys.stdout
+
         for i in range(10):
             __pypy__.thread._signals_exit()
             try:
                 done = []
                 interrupted = []
-                print 'starting',i
                 thread.start_new_thread(subthread, ())
                 for j in range(10):
                     if len(done): break
             py.test.skip("this is only a test for -A runs on top of pypy")
 
     def test_enable_signals(self):
-        import __pypy__, thread, signal, time
+        import __pypy__, thread, time
 
         interrupted = []
         lock = thread.allocate_lock()

rpython/rlib/rposix.py

     os_kill = rwin32.os_kill
 else:
     os_kill = os.kill
-    

rpython/rlib/streamio.py

 
 def _setfd_binary(fd):
     pass
-    
+
 def fdopen_as_stream(fd, mode, buffering=-1):
     # XXX XXX XXX you want do check whether the modes are compatible
     # otherwise you get funny results