(self)
| 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'.""" |
no test coverage detected