> import warnings > warnings.warn('foo') > > % python t.py > t.py:2: UserWarning: foo > warnings.warn('foo') > > Is there a way to just issue the warning message itself, or to at least > suppress printing the line where the warning occurred (" > warnings.warn('foo')" in the example)?
In case anyone else is searching for a solution to this the following sort of works in Python 2.1: warnings.warn_explicit('foo', UserWarning, '', '') :: UserWarning: foo I'm new to Python so if there is a better way to do this please let me know. Jasmin -- http://mail.python.org/mailman/listinfo/python-list