MCPcopy Create free account
hub / github.com/pexpect/pexpect / eof

Method eof

pexpect/expect.py:100–122  ·  view source on GitHub ↗
(self, err=None)

Source from the content-addressed store, hash-verified

98 return self.do_search(window, freshlen)
99
100 def eof(self, err=None):
101 spawn = self.spawn
102
103 spawn.before = spawn._before.getvalue()
104 spawn._buffer = spawn.buffer_type()
105 spawn._before = spawn.buffer_type()
106 spawn.after = EOF
107 index = self.searcher.eof_index
108 if index >= 0:
109 spawn.match = EOF
110 spawn.match_index = index
111 return index
112 else:
113 spawn.match = None
114 spawn.match_index = None
115 msg = str(spawn)
116 msg += '\nsearcher: %s' % self.searcher
117 if err is not None:
118 msg = str(err) + '\n' + msg
119
120 exc = EOF(msg)
121 exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
122 raise exc
123
124 def timeout(self, err=None):
125 spawn = self.spawn

Callers 1

expect_loopMethod · 0.95

Calls 1

EOFClass · 0.85

Tested by

no test coverage detected