Commit fb1ea5f0 authored by Brandon Carpenter's avatar Brandon Carpenter

Fix test for issues #461 and #471 on Python 2.

parent 6e0046e1
......@@ -10,6 +10,7 @@ import sys
if sys.argv[1:] == ['subprocess']:
import gevent
def task():
sys.stdout.write('ready\n')
sys.stdout.flush()
......@@ -20,7 +21,9 @@ if sys.argv[1:] == ['subprocess']:
pass
else:
import signal
from subprocess import Popen, PIPE, TimeoutExpired
from subprocess import Popen, PIPE
import time
if sys.platform.startswith('win'):
from subprocess import CREATE_NEW_PROCESS_GROUP
kwargs = {'creationflags': CREATE_NEW_PROCESS_GROUP}
......@@ -29,9 +32,11 @@ else:
p = Popen([sys.executable, __file__, 'subprocess'], stdout=PIPE, **kwargs)
p.stdout.readline()
p.send_signal(signal.SIGINT)
try:
p.wait(3)
except TimeoutExpired:
for i in range(30):
if p.poll() is not None:
break
time.sleep(0.1)
else:
p.terminate()
sys.exit(1)
sys.exit(p.returncode)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment