Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 795a48c

Browse files
committed
cope with class exceptions
1 parent ee6310a commit 795a48c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Demo/stdwin/python.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ def do_exec(win):
381381
except KeyboardInterrupt:
382382
print '[Interrupt]'
383383
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__
385387
if sys.exc_value <> None:
386388
msg = msg + ': ' + `sys.exc_value`
387389
if win.insertError:

0 commit comments

Comments
 (0)