lsst-sims / legacy_sims_movingObjects

3 stars 5 forks source link

call to showwarning() in generateCoefficients.py does not seem to work #5

Closed danielsf closed 8 years ago

danielsf commented 8 years ago

I just had a run of generateCoefficients.py fail with

Traceback (most recent call last):
  File "/global/u1/d/danielsf/sims_movingObjects/bin/generateCoefficients.py", line 155, in <module>
    UserWarning, log)
TypeError: _show_warning() takes at least 4 arguments (3 given)

Consulting the documentation here

https://docs.python.org/2/library/warnings.html#warnings.showwarning

it looks like showwarning() requires a lineno argument (though it is not specified what lineno means, or why the warning cannot just be appended to the end of the file)

danielsf commented 8 years ago

according to here

http://docstore.mik.ua/orelly/other/python/0596001886_pythonian-chp-17-sect-3.html

lineno is supposed to represent the line number in the source code raising the warning.

I will make a pull request.