From: Samuele P. <ped...@us...> - 2004-01-27 19:23:24
|
Update of /cvsroot/jython/bugtests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31184 Modified Files: driver.py Added Files: test382.py Log Message: add test382 for bug #625391 traceback.print_exc --- NEW FILE: test382.py --- """ catching frame wasn't captured in a traceback """ import sys def check(tb,expt_lines): assert tb.tb_frame is sys._getframe(1),"catching frame should be included" lines=[] while tb: lines.append(tb.tb_lineno) tb = tb.tb_next assert expt_lines==lines, "bogus line numbers: %s vs. expected %s" % (lines,expt_lines) def f(): try: raise KeyError # 17 except: raise try: f() # 22 except: t,e,tb = sys.exc_info() check(tb,[22,17]) try: f() # 28 except KeyError,e: t,e,tb = sys.exc_info() check(tb,[28,17]) try: 1/0 # 34 except: t,e,tb = sys.exc_info() check(tb,[34]) try: try: 1/0 # 41 except: raise except: t,e,tb = sys.exc_info() check(tb,[41]) Index: driver.py =================================================================== RCS file: /cvsroot/jython/bugtests/driver.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** driver.py 6 Aug 2003 00:02:37 -0000 1.11 --- driver.py 27 Jan 2004 19:22:19 -0000 1.12 *************** *** 19,23 **** if warnings: print "LOUD warnings" ! for i in range(382): m = None n = "test%3.3d" % i --- 19,23 ---- if warnings: print "LOUD warnings" ! for i in range(383): m = None n = "test%3.3d" % i |