MCPcopy Index your code
hub / github.com/python/cpython / getresp

Method getresp

Lib/ftplib.py:243–255  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

241 # Internal: get a response from the server.
242 # Raise various errors if the response indicates an error
243 def getresp(self):
244 resp = self.getmultiline()
245 if self.debugging:
246 print('*resp*', self.sanitize(resp))
247 self.lastresp = resp[:3]
248 c = resp[:1]
249 if c in {'1', '2', '3'}:
250 return resp
251 if c == '4':
252 raise error_temp(resp)
253 if c == '5':
254 raise error_perm(resp)
255 raise error_proto(resp)
256
257 def voidresp(self):
258 """Expect a response beginning with '2'."""

Callers 4

connectMethod · 0.95
voidrespMethod · 0.95
sendcmdMethod · 0.95
ntransfercmdMethod · 0.95

Calls 5

getmultilineMethod · 0.95
sanitizeMethod · 0.95
error_tempClass · 0.85
error_permClass · 0.85
error_protoClass · 0.70

Tested by

no test coverage detected