We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5436e55 commit 3399dd7Copy full SHA for 3399dd7
ptyprocess/ptyprocess.py
@@ -283,10 +283,14 @@ def spawn(
283
os.execv(command, argv)
284
else:
285
os.execvpe(command, argv, env)
286
- except OSError as err:
+ except Exception as err:
287
# [issue #119] 5. If exec fails, the child writes the error
288
# code back to the parent using the pipe, then exits.
289
- tosend = 'OSError:{}:{}'.format(err.errno, str(err))
+ if isinstance(err, OSError):
290
+ tosend = 'OSError:{}:{}'.format(err.errno, str(err))
291
+ else:
292
+ cls_name = err.__class__.__name__
293
+ tosend = 'Exception:0:{}: {}'.format(cls_name, str(err))
294
if PY3:
295
tosend = tosend.encode('utf-8')
296
os.write(exec_err_pipe_write, tosend)
0 commit comments