Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can run your program and cause warning to be raised as exceptions by doing the following:

python -W error program.py

alternately, put this at the top of your code:

warnings.simplefilter("error")

That way a nice stack trace is generated and you can see which call(s) are causing the problem.

Refer to the warnings documentation for more details, including how your could just ignore printing the warnings if you find that's the best way to resolve your problem.

You can run your program and cause warning to be raised as exceptions by doing the following:

python -W error program.py

alternately, put this at the top of your code:

warnings.simplefilter("error")

That way a nice stack trace is generated and you can see which call(s) are causing the problem.

Refer to the warnings documentation for more details, including how your could just ignore suppress printing the warnings if you find that's the best way to resolve your problem.

You can run your program and cause warning to be raised as exceptions by doing the following:

python -W error program.py

alternately, put this at the top of your code:

import warnings    
warnings.simplefilter("error")

That way a nice stack trace is generated and you can see which call(s) are causing the problem.

Refer to the warnings documentation for more details, including how your could just suppress printing the warnings if you find that's the best way to resolve your problem.