Commits

Philip Jenvey committed ee703e7

prefer print as a statement and one more debug print

  • Participants
  • Parent commits 64bcad2

Comments (0)

Files changed (1)

pypy/module/__pypy__/test/test_signal.py

         import __pypy__, thread, signal, time, sys
 
         def subthread():
+            print('subthread started')
             try:
                 with __pypy__.thread.signals_enabled:
                     thread.interrupt_main()
                     for i in range(10):
-                        print 'x'
+                        print('x')
                         time.sleep(0.1)
             except BaseException, e:
                 interrupted.append(e)
             finally:
-                print 'subthread stops, interrupted=%r' % (interrupted,)
+                print('subthread stops, interrupted=%r' % (interrupted,))
                 done.append(None)
 
         # This is normally called by app_main.py
             try:
                 done = []
                 interrupted = []
-                print '--- start ---'
+                print('--- start ---')
                 thread.start_new_thread(subthread, ())
                 for j in range(10):
                     if len(done): break
-                    print '.'
+                    print('.')
                     time.sleep(0.1)
-                print 'main thread loop done'
+                print('main thread loop done')
                 assert len(done) == 1
                 assert len(interrupted) == 1
                 assert 'KeyboardInterrupt' in interrupted[0].__class__.__name__
         def threadfunction():
             pid = fork()
             if pid == 0:
-                print 'in child'
+                print('in child')
                 # signal() only works from the 'main' thread
                 signal.signal(signal.SIGUSR1, signal.SIG_IGN)
                 os._exit(42)