Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

python -m ipdb #3

Closed
sirex opened this Issue · 4 comments

2 participants

@sirex

I can start pdb this way:

python -m pdb manage.py test tests

But with ipdb this does not work:

python -m ipdb manage.py test tests     
python: No module named ipdb.__main__; 'ipdb' is a package and cannot be directly executed
@gotcha
Owner

ipdb is distributed as an egg : this enforces that it is a package.

At first sight, I see no way to fix this issue.

@sirex

As I understand, information about how module is searched and executed, when called with -m is described here:
http://docs.python.org/library/runpy.html

@gotcha
Owner
@sirex

It works!

$ bin/python -m ipdb boo.py
> /tmp/ipdb-test/boo.py(1)<module>()
----> 1 print('boo')
      2 
      3 for i in range(3):

ipdb> n
boo
> /tmp/ipdb-test/boo.py(3)<module>()
      2 
----> 3 for i in range(3):
      4     print(i)

ipdb> n
> /tmp/ipdb-test/boo.py(4)<module>()
      2 
      3 for i in range(3):
----> 4     print(i)

ipdb> p i
0
ipdb> c
0
1
2
The program finished and will be restarted
> /tmp/ipdb-test/boo.py(1)<module>()
----> 1 print('boo')
      2 
      3 for i in range(10):

ipdb> exit

$

Thanks!

@sirex sirex closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.