Run our cmdloop(), catching KeyboardInterrupt
(self)
| 57 | self.run() |
| 58 | |
| 59 | def run(self): |
| 60 | "Run our cmdloop(), catching KeyboardInterrupt" |
| 61 | while True: |
| 62 | try: |
| 63 | self.cmdloop() |
| 64 | break |
| 65 | except KeyboardInterrupt: |
| 66 | # Output a message - unless it's also interrupted |
| 67 | # pylint: disable=broad-except |
| 68 | try: |
| 69 | output('\nInterrupt\n') |
| 70 | except Exception: |
| 71 | pass |
| 72 | # pylint: enable=broad-except |
| 73 | |
| 74 | def emptyline(self): |
| 75 | "Don't repeat last command when you hit return." |