This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author isandler
Recipients
Date 2006-05-23.03:36:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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?
History
Date User Action Args
2007-08-23 14:39:30adminlinkissue1472251 messages
2007-08-23 14:39:30admincreate