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

Method timeout

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

Source from the content-addressed store, hash-verified

122 raise exc
123
124 def timeout(self, err=None):
125 spawn = self.spawn
126
127 spawn.before = spawn._before.getvalue()
128 spawn.after = TIMEOUT
129 index = self.searcher.timeout_index
130 if index >= 0:
131 spawn.match = TIMEOUT
132 spawn.match_index = index
133 return index
134 else:
135 spawn.match = None
136 spawn.match_index = None
137 msg = str(spawn)
138 msg += '\nsearcher: %s' % self.searcher
139 if err is not None:
140 msg = str(err) + '\n' + msg
141
142 exc = TIMEOUT(msg)
143 exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
144 raise exc
145
146 def errored(self):
147 spawn = self.spawn

Callers 3

expect_loopMethod · 0.95
expect_asyncFunction · 0.80
expect_asyncFunction · 0.80

Calls 1

TIMEOUTClass · 0.85

Tested by

no test coverage detected