Message28281
Logged In: YES
user_id=971153
Well, I don't see anything in bdb's run which could
overwrite your namespace..
What seems to be happenning in your example is that bdb's
first line event happens while bdb is still in run(), so you
when you see pdb's prompt, are in bdb's namespace not in
yours.. If you do "next" you will get where you should be..
bagira:~> python2.4
Python 2.4.1 (#2, May 5 2005, 11:32:06)
>>> def x(): print "in x"
>>> import pdb
>>> pdb.run( x())
in x
TypeError: unsupported operand type(s) for +: 'NoneType'
and 'str'
>>> pdb.run( 'x()' )
> /usr/lib/python2.4/pdb.py(987)run()
-> Pdb().run(statement, globals, locals)
(Pdb) n #now you are back in your namespace
> <string>(1)?()
(Pdb) p x #and you get your symbols back
<function x at 0x4021be2c>
(Pdb) p pdb
<module 'pdb' from '/usr/lib/python2.4/pdb.pyc'>
(Pdb) n
in x
--Return--
> <string>(1)?()->None
What do you think? |
|
Date |
User |
Action |
Args |
2007-08-23 14:39:30 | admin | link | issue1472251 messages |
2007-08-23 14:39:30 | admin | create | |
|