mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-19 04:24:13 +08:00
Include stderr with "subprocess has crashed" exception (#1124)
* Include stderr with "subprocess has crashed" exception This does not add it to the other similar exception raised from `kill`, since this should be something like "was killed already" anyway. * fixup! Include stderr with "subprocess has crashed" exception
This commit is contained in:
committed by
Dave Halter
parent
106b11f1af
commit
ea71dedaa1
@@ -142,6 +142,7 @@ class _CompiledSubprocess(object):
|
|||||||
args,
|
args,
|
||||||
stdin=subprocess.PIPE,
|
stdin=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
# Use system default buffering on Python 2 to improve performance
|
# Use system default buffering on Python 2 to improve performance
|
||||||
# (this is already the case on Python 3).
|
# (this is already the case on Python 3).
|
||||||
bufsize=-1
|
bufsize=-1
|
||||||
@@ -203,9 +204,18 @@ class _CompiledSubprocess(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
is_exception, traceback, result = pickle_load(self._process.stdout)
|
is_exception, traceback, result = pickle_load(self._process.stdout)
|
||||||
except EOFError:
|
except EOFError as eof_error:
|
||||||
|
try:
|
||||||
|
stderr = self._process.stderr.read()
|
||||||
|
except Exception as exc:
|
||||||
|
stderr = '<empty/not available (%r)>' % exc
|
||||||
self.kill()
|
self.kill()
|
||||||
raise InternalError("The subprocess %s has crashed." % self._executable)
|
raise InternalError(
|
||||||
|
"The subprocess %s has crashed (%r, stderr=%s)." % (
|
||||||
|
self._executable,
|
||||||
|
eof_error,
|
||||||
|
stderr,
|
||||||
|
))
|
||||||
|
|
||||||
if is_exception:
|
if is_exception:
|
||||||
# Replace the attribute error message with a the traceback. It's
|
# Replace the attribute error message with a the traceback. It's
|
||||||
|
|||||||
Reference in New Issue
Block a user