Mercurial > cpython-lru_cache-weakref
comparison Demo/stdwin/python.py @ 2593:8df574a655ad legacy-trunk
cope with class exceptions
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 22 Mar 1995 12:17:10 +0000 |
| parents | 17e5c94f862f |
| children | 73758db2f464 |
comparison
equal
deleted
inserted
replaced
| 2592:763eb47975dd | 2593:8df574a655ad |
|---|---|
| 379 try: | 379 try: |
| 380 exec(command, win.globals) | 380 exec(command, win.globals) |
| 381 except KeyboardInterrupt: | 381 except KeyboardInterrupt: |
| 382 print '[Interrupt]' | 382 print '[Interrupt]' |
| 383 except: | 383 except: |
| 384 msg = sys.exc_type | 384 if type(sys.exc_type) == type(''): |
| 385 msg = sys.exc_type | |
| 386 else: msg = sys.exc_type.__name__ | |
| 385 if sys.exc_value <> None: | 387 if sys.exc_value <> None: |
| 386 msg = msg + ': ' + `sys.exc_value` | 388 msg = msg + ': ' + `sys.exc_value` |
| 387 if win.insertError: | 389 if win.insertError: |
| 388 stdwin.fleep() | 390 stdwin.fleep() |
| 389 replace(win, msg + '\n') | 391 replace(win, msg + '\n') |
