[AstroPy] Capturing pyfits warnings
Wed Sep 15 09:06:21 CDT 2010
I am not sure I understand exactly what is going on here, but if having the warnings module issue exceptions instead of warnings is causing another warning to be raised as an exception that you would like to remain as a warning, you can fix this by using filterwarnings and supplying a regular expression that matches just the warning that you want raised as an exception. In your case something like:
warnings.filterwarnings('error',message='.*Warning: File may have been.*"')
If you contact me directly at email@example.com with more details, especially if you can point me to a fits file that is causing the problem, I may be able to be of more help.
More information about the AstroPy