From 6ddc2427463dd7a1f89bfa7b5ba7f25d2509d420 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 21 Aug 2018 01:28:13 +0200 Subject: [PATCH] Ignore some errors that are happening when the Python process ends and its subprocesses are cleaned up --- jedi/evaluate/compiled/subprocess/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/jedi/evaluate/compiled/subprocess/__init__.py b/jedi/evaluate/compiled/subprocess/__init__.py index 430d25c4..cf21b51b 100644 --- a/jedi/evaluate/compiled/subprocess/__init__.py +++ b/jedi/evaluate/compiled/subprocess/__init__.py @@ -203,13 +203,14 @@ class CompiledSubprocess(object): def _kill(self): self.is_crashed = True - if getattr(subprocess, 'signal', None) is None: - # If the Python process is terminating, sometimes it will remove - # the signal module before a lot of other things, so check for it - # and don't do anything, because the process is killed anyways. - return - self._process.kill() - self._process.wait() + try: + self._process.kill() + self._process.wait() + except (AttributeError, TypeError): + # If the Python process is terminating, it will remove some modules + # earlier than others and in general it's unclear how to deal with + # that so we just ignore the exceptions here. + pass def __del__(self): if not self.is_crashed: