(self, line)
| 374 | self.message(repr(obj)) |
| 375 | |
| 376 | def default(self, line): |
| 377 | if line[:1] == '!': line = line[1:] |
| 378 | locals = self.curframe_locals |
| 379 | globals = self.curframe.f_globals |
| 380 | try: |
| 381 | code = compile(line + '\n', '<stdin>', 'single') |
| 382 | save_stdout = sys.stdout |
| 383 | save_stdin = sys.stdin |
| 384 | save_displayhook = sys.displayhook |
| 385 | try: |
| 386 | sys.stdin = self.stdin |
| 387 | sys.stdout = self.stdout |
| 388 | sys.displayhook = self.displayhook |
| 389 | exec(code, globals, locals) |
| 390 | finally: |
| 391 | sys.stdout = save_stdout |
| 392 | sys.stdin = save_stdin |
| 393 | sys.displayhook = save_displayhook |
| 394 | except: |
| 395 | exc_info = sys.exc_info()[:2] |
| 396 | self.error(traceback.format_exception_only(*exc_info)[-1].strip()) |
| 397 | |
| 398 | def precmd(self, line): |
| 399 | """Handle alias expansion and ';;' separator.""" |
nothing calls this directly
no test coverage detected