##// END OF EJS Templates
Handle Unix ESRCH errors gracefully in kill_kernel.
epatters -
Show More
@@ -835,8 +835,15 b' class KernelManager(HasTraits):'
835 except OSError, e:
835 except OSError, e:
836 # In Windows, we will get an Access Denied error if the process
836 # In Windows, we will get an Access Denied error if the process
837 # has already terminated. Ignore it.
837 # has already terminated. Ignore it.
838 if not (sys.platform == 'win32' and e.winerror == 5):
838 if sys.platform == 'win32':
839 raise
839 if e.winerror != 5:
840 raise
841 # On Unix, we may get an ESRCH error if the process has already
842 # terminated. Ignore it.
843 else:
844 from errno import ESRCH
845 if e.errno != ESRCH:
846 raise
840 self.kernel = None
847 self.kernel = None
841 else:
848 else:
842 raise RuntimeError("Cannot kill kernel. No kernel is running!")
849 raise RuntimeError("Cannot kill kernel. No kernel is running!")
General Comments 0
You need to be logged in to leave comments. Login now