mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-18 14:29:40 +08:00
Ignore some errors that are happening when the Python process ends and its subprocesses are cleaned up
This commit is contained in:
@@ -203,13 +203,14 @@ class CompiledSubprocess(object):
|
|||||||
|
|
||||||
def _kill(self):
|
def _kill(self):
|
||||||
self.is_crashed = True
|
self.is_crashed = True
|
||||||
if subprocess.signal is None:
|
try:
|
||||||
# If the Python process is terminating, sometimes it will remove
|
self._process.kill()
|
||||||
# the signal module before a lot of other things, so check for it
|
self._process.wait()
|
||||||
# and don't do anything, because the process is killed anyways.
|
except (AttributeError, TypeError):
|
||||||
return
|
# If the Python process is terminating, it will remove some modules
|
||||||
self._process.kill()
|
# earlier than others and in general it's unclear how to deal with
|
||||||
self._process.wait()
|
# that so we just ignore the exceptions here.
|
||||||
|
pass
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if not self.is_crashed:
|
if not self.is_crashed:
|
||||||
|
|||||||
Reference in New Issue
Block a user