MCPcopy Index your code
hub / github.com/RustPython/RustPython / _getline

Method _getline

Lib/poplib.py:132–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

130 # Raise error_proto('-ERR EOF') if the connection is closed.
131
132 def _getline(self):
133 line = self.file.readline(_MAXLINE + 1)
134 if len(line) > _MAXLINE:
135 raise error_proto('line too long')
136
137 if self._debugging > 1: print('*get*', repr(line))
138 if not line: raise error_proto('-ERR EOF')
139 octets = len(line)
140 # server can send any combination of CR & LF
141 # however, 'readline()' returns lines ending in LF
142 # so only possibilities are ...LF, ...CRLF, CR...LF
143 if line[-2:] == CRLF:
144 return line[:-2], octets
145 if line[:1] == CR:
146 return line[1:-1], octets
147 return line[:-1], octets
148
149
150 # Internal: get a response from the server.

Callers 2

_getrespMethod · 0.95
_getlongrespMethod · 0.95

Calls 5

lenFunction · 0.85
reprFunction · 0.85
error_protoClass · 0.70
printFunction · 0.50
readlineMethod · 0.45

Tested by

no test coverage detected