AnimatLab
2
Test
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
ErrorTesting2.py
1
import
sys
2
import
traceback
3
4
def
my_excepthook(type, value, tb):
5
print
type.__name__
6
print
value
7
print
""
.join(traceback.format_exception(type, value, tb))
8
9
sys.excepthook = my_excepthook
# see http://docs.python.org/library/sys.html#sys.excepthook
10
11
# some code to generate a naturalistic exception
12
a =
"text"
13
b = 5
14
error = a + b
Libraries
AnimatSimPy
Scripts
ErrorTesting2.py
Generated on Tue Sep 29 2015 07:07:14 for AnimatLab by
1.8.10