File: except.py

package info (click to toggle)
pydb 1.19-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,952 kB
  • ctags: 1,412
  • sloc: python: 3,065; perl: 2,479; sh: 586; makefile: 555; lisp: 265; ansic: 16
file content (34 lines) | stat: -rwxr-xr-x 847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# $Id: except.py.in,v 1.2 2006/07/11 10:53:36 rockyb Exp $
"""Test to see if handles an exception when an error is raised."""
import os, sys

top_builddir = "../"
if top_builddir[-1] != os.path.sep:
    top_builddir += os.path.sep
sys.path.insert(0, os.path.join(top_builddir, 'pydb'))
top_srcdir = ".."
if top_srcdir[-1] != os.path.sep:
    top_srcdir += os.path.sep
sys.path.insert(0, os.path.join(top_srcdir, 'pydb'))

print __doc__

import pydb
pydb.set_trace()  # we go into the debugger
print "Returning from the debugger"
# Set a variable so we can show the state is
# somewhere after the above set_trace()
z='After set_trace'
try:
    # The below statement should not enter the debugger
    x=2/0 
except:
    pass 
# We should enter the debugger on the next statement.
y=1/0  # Bullwinkle: This time, for sure!
pass