Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Can pdb be set to break on warnings?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


lm401 at cam

Oct 11, 2006, 2:22 AM

Post #1 of 6 (153 views)
Permalink
Can pdb be set to break on warnings?

Hello,

I use pdb under Linux to debug my Python code, as in:

python -m pdb myprogram.py

By default it does a postmortem of unhandled exceptions, is there a way
to get it to break on warnings?

Thanks a lot,


Lorcan.

--
http://mail.python.org/mailman/listinfo/python-list


fredrik at pythonware

Oct 11, 2006, 2:38 AM

Post #2 of 6 (145 views)
Permalink
Re: Can pdb be set to break on warnings? [In reply to]

LorcanM wrote:

> I use pdb under Linux to debug my Python code, as in:
>
> python -m pdb myprogram.py
>
> By default it does a postmortem of unhandled exceptions, is there a way
> to get it to break on warnings?

is

python -m pdb -Werror myprogram.py

what you're looking for ?

</F>

--
http://mail.python.org/mailman/listinfo/python-list


lm401 at cam

Oct 11, 2006, 3:31 AM

Post #3 of 6 (155 views)
Permalink
Re: Can pdb be set to break on warnings? [In reply to]

Fredrik Lundh wrote:
> LorcanM wrote:
>
> > I use pdb under Linux to debug my Python code, as in:
> >
> > python -m pdb myprogram.py
> >
> > By default it does a postmortem of unhandled exceptions, is there a way
> > to get it to break on warnings?
>
> is
>
> python -m pdb -Werror myprogram.py
>
> what you're looking for ?
>
> </F>


It sounds like what I want, but it doesn't work for me. When I try the
above line of code, it replies:
Error: -Werror does not exist

I'm running Python 2.4.3

Thanks for the help,


Lorcan.

--
http://mail.python.org/mailman/listinfo/python-list


fredrik at pythonware

Oct 11, 2006, 3:38 AM

Post #4 of 6 (142 views)
Permalink
Re: Can pdb be set to break on warnings? [In reply to]

"LorcanM" wrote:

>> python -m pdb -Werror myprogram.py
>
> It sounds like what I want, but it doesn't work for me. When I try the
> above line of code, it replies:
>
> Error: -Werror does not exist
>
> I'm running Python 2.4.3

sorry, pilot cut and paste error. try:

python -Werror -m pdb myprogram.py

(-m script must be the last option before the script arguments, for pretty
obvious reasons).

</F>



--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py at yahoo

Oct 11, 2006, 3:59 AM

Post #5 of 6 (146 views)
Permalink
Re: Can pdb be set to break on warnings? [In reply to]

At Wednesday 11/10/2006 07:31, LorcanM wrote:

> >
> > python -m pdb -Werror myprogram.py
> >
>It sounds like what I want, but it doesn't work for me. When I try the
>above line of code, it replies:
>Error: -Werror does not exist

Try: python -h


--
Gabriel Genellina
Softlab SRL





__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas


lm401 at cam

Oct 11, 2006, 7:38 AM

Post #6 of 6 (145 views)
Permalink
Re: Can pdb be set to break on warnings? [In reply to]

Fredrik Lundh wrote:
> "LorcanM" wrote:
>
> >> python -m pdb -Werror myprogram.py
> >
> > It sounds like what I want, but it doesn't work for me. When I try the
> > above line of code, it replies:
> >
> > Error: -Werror does not exist
> >
> > I'm running Python 2.4.3
>
> sorry, pilot cut and paste error. try:
>
> python -Werror -m pdb myprogram.py
>
> (-m script must be the last option before the script arguments, for pretty
> obvious reasons).
>
> </F>


Thanks for that - that does the trick,


Lorcan.

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.