Allow for type of hdu.size changing in PyFITS 3.1

This commit is contained in:
James Turner
2012-05-28 19:46:39 -04:00
parent 2eb0a2552f
commit cb44e508f3
+6 -2
View File
@@ -95,8 +95,12 @@ def imread_collection(load_pattern, conserve_memory=True):
isinstance(hdu, pyfits.PrimaryHDU):
# Ignore (primary) header units with no data (use '.size'
# rather than '.data' to avoid actually loading the image):
if hdu.size() > 0:
ext_list.append((filename, n))
try:
if hdu.size() > 0:
ext_list.append((filename, n))
except TypeError: # (size changed to int in PyFITS 3.1)
if hdu.size > 0:
ext_list.append((filename, n))
hdulist.close()
return io.ImageCollection(ext_list, load_func=FITSFactory,