Something wrong with pdb in Python2.2a1

Joonas Paalasmaa joonas at olen.to
Tue Aug 14 14:00:02 CEST 2001


Is there something wrong with pdb in Python2.2a1 because it dies
instead of catching the exception.
See session below.


C:\>cat pdb_test.py
#!/python/python

import pdb, sys
print sys.version
print pdb
pdb.run("""
def zero():
    return 0

print 5/zero()
""")

C:\>python16 pdb_test.py
1.6 (#0, Sep  5 2000, 08:16:13) [MSC 32 bit (Intel)]
<module 'pdb' from 'C:\PYTHON16\lib\pdb.pyc'>
> C:\<string>(0)?()
(Pdb) cont
> C:\<string>(2)?()
(Pdb) cont
> C:\<string>(5)?()
(Pdb) cont
ZeroDivisionError: 'integer division or modulo'
> C:\<string>(5)?()
(Pdb) quit

C:\>python22 pdb_test.py
2.2a1 (#21, Jul 18 2001, 04:25:46) [MSC 32 bit (Intel)]
<module 'pdb' from 'C:\PYTHON\lib\pdb.pyc'>
> <string>(0)?()
(Pdb) cont
Traceback (most recent call last):
  File "pdb_test.py", line 6, in ?
    pdb.run("""
  File "C:\PYTHON\lib\pdb.py", line 882, in run
    Pdb().run(statement, globals, locals)
  File "C:\PYTHON\lib\bdb.py", line 352, in run
    exec cmd in globals, locals
  File "<string>", line 5, in ?
ZeroDivisionError: integer division or modulo by zero

C:\>



More information about the Python-list mailing list