Mercurial > cpython-lru_cache-weakref
comparison Demo/stdwin/python.py @ 867:cb146aa987c9 legacy-trunk
Make it at least legal grammar!
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 15 May 1992 15:40:30 +0000 |
| parents | 8f7b31a8a678 |
| children | 56636395724d |
comparison
equal
deleted
inserted
replaced
| 866:06c078750e80 | 867:cb146aa987c9 |
|---|---|
| 470 n = len(inputwindows) | 470 n = len(inputwindows) |
| 471 title = n*'(' + 'Requesting input...' + ')'*n | 471 title = n*'(' + 'Requesting input...' + ')'*n |
| 472 self.win.settitle(title) | 472 self.win.settitle(title) |
| 473 inputwindows.insert(0, self.win) | 473 inputwindows.insert(0, self.win) |
| 474 try: | 474 try: |
| 475 mainloop.mainloop() | 475 try: |
| 476 except InputAvailable, (exc, val): # See do_exec above. | 476 mainloop.mainloop() |
| 477 if exc: | 477 except InputAvailable, (exc, val): # See do_exec above. |
| 478 raise exc, val | 478 if exc: |
| 479 if val[-1:] == '\n': | 479 raise exc, val |
| 480 val = val[:-1] | 480 if val[-1:] == '\n': |
| 481 return val | 481 val = val[:-1] |
| 482 return val | |
| 482 finally: | 483 finally: |
| 483 del inputwindows[0] | 484 del inputwindows[0] |
| 484 self.win.settitle(save_title) | 485 self.win.settitle(save_title) |
| 485 # If we don't catch InputAvailable, something's wrong... | 486 # If we don't catch InputAvailable, something's wrong... |
| 486 raise EOFError | 487 raise EOFError |
