##// END OF EJS Templates
Avoid error while killing subprocess in %%script
Takafumi Arakaki -
Show More
@@ -208,6 +208,7 b' class ScriptMagics(Magics, Configurable):'
208 208 try:
209 209 out, err = p.communicate(cell)
210 210 except KeyboardInterrupt:
211 try:
211 212 p.send_signal(signal.SIGINT)
212 213 time.sleep(0.1)
213 214 if p.poll() is not None:
@@ -220,6 +221,8 b' class ScriptMagics(Magics, Configurable):'
220 221 return
221 222 p.kill()
222 223 print "Process is killed."
224 except:
225 print "Failed to kill process properly (pid={0})".format(p.pid)
223 226 return
224 227 out = py3compat.bytes_to_str(out)
225 228 err = py3compat.bytes_to_str(err)
General Comments 0
You need to be logged in to leave comments. Login now