00001 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall. 00002 # 00003 # This file is part of the Python-on-a-Chip program. 00004 # Python-on-a-Chip is free software: you can redistribute it and/or modify 00005 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. 00006 # 00007 # Python-on-a-Chip is distributed in the hope that it will be useful, 00008 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 00011 # is seen in the file COPYING up one directory from this. 00012 00013 # 00014 # System Test 119 00015 # Print Python traceback on exception 00016 # 00017 00018 def divzero(n): 00019 print "In divzero" 00020 a = n/0 00021 00022 def foo(): 00023 divzero(42) 00024 00025 def bar(): 00026 foo() 00027 00028 def baz(): 00029 bar() 00030 00031 if ismain(): 00032 print "calling baz()" 00033 print "Expecting a ZeroDiv exception and traceback to print" 00034 baz() # expect exception and traceback