Skip to content

Commit

Permalink
Avoid stopping in ipdb until we reach the main script.
Browse files Browse the repository at this point in the history
For example::

    In [1]: %run -d -b 52 setup.py
    Breakpoint 1 at /tmp/ipython/setup.py:52
    NOTE: Enter 'c' at the ipdb>  prompt to start your script.
    > /tmp/ipython/setup.py(7)<module>()
          6 Under Windows, the command sdist is not supported, since IPython
    ----> 7 requires utilities which are not available under Windows."""
          8

compared to the previous behavior::

    In [1]: %run -d -b 52 setup.py
    Breakpoint 1 at /tmp/ipython/setup.py:52
    NOTE: Enter 'c' at the ipdb>  prompt to start your script.
    > <string>(1)<module>()

Closes ipython#1679 ("List command desn't work in ipdb debugger the first time")
  • Loading branch information
bfroehle committed Nov 6, 2012
1 parent fb4a45e commit 63dfa20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions IPython/core/magics/execution.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -563,6 +563,11 @@ def run(self, parameter_s='', runner=None,
return return
# if we find a good linenumber, set the breakpoint # if we find a good linenumber, set the breakpoint
deb.do_break('%s:%s' % (filename, bp)) deb.do_break('%s:%s' % (filename, bp))

# Mimic Pdb._runscript(...)
deb._wait_for_mainpyfile = True
deb.mainpyfile = deb.canonic(filename)

# Start file run # Start file run
print "NOTE: Enter 'c' at the", print "NOTE: Enter 'c' at the",
print "%s prompt to start your script." % deb.prompt print "%s prompt to start your script." % deb.prompt
Expand Down

0 comments on commit 63dfa20

Please sign in to comment.