Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python -m ipdb #3

Comments

@sirex
Copy link

sirex commented Jun 9, 2011

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
Copy link
Owner

gotcha commented Jun 10, 2011

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
Copy link
Author

sirex commented Jun 10, 2011

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
Copy link
Owner

gotcha commented Jun 10, 2011

Le 10/06/11 15:07, sirex a écrit :

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

I tried to implement the feature : however, as documented in
http://docs.python.org/library/runpy.html, it will work only for 2.7

Would you try the code I pushed to confirm it works for you before I
release ?

Thanks

Godefroid Chapelle (aka __gotcha) http://bubblenet.be

@sirex
Copy link
Author

sirex commented Jun 11, 2011

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 as completed Jun 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment