summaryrefslogtreecommitdiff
path: root/pexpect/pty_spawn.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2015-12-14 12:23:47 +0100
committerThomas Kluyver <takowl@gmail.com>2015-12-14 12:23:47 +0100
commit8af334bf38a79778d96eed63e99a0a5e4b2f6f80 (patch)
tree39fbc3e7246df5db004c2038e10f307f759d16ec /pexpect/pty_spawn.py
parent1192bec9cdc385e30be98c01d6d1d6f5a1a0ff75 (diff)
parent011ad6090e183ce359c0a74bbd2f2530e1d5178c (diff)
downloadpexpect-git-8af334bf38a79778d96eed63e99a0a5e4b2f6f80.tar.gz
Merge pull request #310 from pexpect/bugfix-my_spawn-has_no-ptyproc
Bugfix: AttributeError: 'spawn' object has no attribute 'ptyproc'
Diffstat (limited to 'pexpect/pty_spawn.py')
-rw-r--r--pexpect/pty_spawn.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py
index 5fc5b4c..5870f73 100644
--- a/pexpect/pty_spawn.py
+++ b/pexpect/pty_spawn.py
@@ -209,7 +209,8 @@ class spawn(SpawnBase):
s.append('match: %r' % (self.match,))
s.append('match_index: ' + str(self.match_index))
s.append('exitstatus: ' + str(self.exitstatus))
- s.append('flag_eof: ' + str(self.flag_eof))
+ if hasattr(self, 'ptyproc'):
+ s.append('flag_eof: ' + str(self.flag_eof))
s.append('pid: ' + str(self.pid))
s.append('child_fd: ' + str(self.child_fd))
s.append('closed: ' + str(self.closed))