summaryrefslogtreecommitdiff
path: root/pexpect/pty_spawn.py
diff options
context:
space:
mode:
authorKristopher H <iix.ftw@gmail.com>2016-10-19 23:31:11 +0200
committerKristopher H <iix.ftw@gmail.com>2016-10-19 23:31:11 +0200
commit803cdc108e3942bc541ce5e0558604dbf8455142 (patch)
treef915ed27ec363fee9f4a3d6cf5cf0b99e3d90ad8 /pexpect/pty_spawn.py
parentb4fb7c414aca7c0bf59fefe23508574b366fb4ed (diff)
downloadpexpect-git-803cdc108e3942bc541ce5e0558604dbf8455142.tar.gz
Raise ExceptionPexpect instead of PtyProcessError in spawn.close
Diffstat (limited to 'pexpect/pty_spawn.py')
-rw-r--r--pexpect/pty_spawn.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py
index d1c6df7..11ad4f8 100644
--- a/pexpect/pty_spawn.py
+++ b/pexpect/pty_spawn.py
@@ -315,7 +315,10 @@ class spawn(SpawnBase):
and SIGINT). '''
self.flush()
- self.ptyproc.close(force=force)
+ with _wrap_ptyprocess_err():
+ # PtyProcessError may be raised if it is not possible to terminate
+ # the child.
+ self.ptyproc.close(force=force)
self.isalive() # Update exit status from ptyproc
self.child_fd = -1