Pushes a line onto the buffer and compiles the code in a way that enables multiline input.
(self, line)
| 156 | return line |
| 157 | |
| 158 | def _push(self, line): |
| 159 | """Pushes a line onto the buffer and compiles the code in a way that |
| 160 | enables multiline input. |
| 161 | """ |
| 162 | code = None |
| 163 | self.buffer.append(line) |
| 164 | if self.need_more_lines: |
| 165 | return None, code |
| 166 | src = "".join(self.buffer) |
| 167 | src = transform_command(src) |
| 168 | try: |
| 169 | code = self.execer.compile(src, mode="single", glbs=self.ctx, locs=None) |
| 170 | self.reset_buffer() |
| 171 | except Exception: # pylint: disable=broad-except |
| 172 | self.reset_buffer() |
| 173 | print_exception() |
| 174 | return src, None |
| 175 | return src, code |
| 176 | |
| 177 | def cmdloop(self, intro=None): |
| 178 | """Enters a loop that reads and execute input from user.""" |
nothing calls this directly
no test coverage detected