From 4545d91929f2cdea2eb8d555bde7377f8c61a4af 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 420e048f..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 subprocess.signal 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: