From b94b45cfa16d6177a6ef3bf9b2a438306823ae69 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 27 Apr 2018 10:23:50 +0200 Subject: [PATCH] Environment._get_version: add msgs with exceptions --- jedi/api/environment.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jedi/api/environment.py b/jedi/api/environment.py index 7e0a8507..d67427bd 100644 --- a/jedi/api/environment.py +++ b/jedi/api/environment.py @@ -77,9 +77,12 @@ class Environment(_BaseEnvironment): stdout, stderr = process.communicate() retcode = process.poll() if retcode: - raise InvalidPythonEnvironment() - except OSError: - raise InvalidPythonEnvironment() + raise InvalidPythonEnvironment( + "Exited with %d (stdout=%r, stderr=%r)" % ( + retcode, stdout, stderr)) + except OSError as exc: + raise InvalidPythonEnvironment( + "Could not get version information: %r" % exc) # Until Python 3.4 wthe version string is part of stderr, after that # stdout.