# check in the case there is extra space after the last HDU or corrupted HDU
exceptValueError:
warnings.warn('Warning: Required keywords missing when trying to read HDU #%d.\n There may be extra bytes after the last HDU or the file is corrupted.'%(len(hduList)+1))
break
# initialize/reset attributes to be used in "update/append" mode
# CardList needs its own _mod attribute since it has methods to change
# the content of header without being able to pass it to the header object
hduList._resize=0
hduList._truncate=0
returnhduList
fitsopen=open
# Convenience functions
class_Zero(int):
def__init__(self):
self=0
def_getext(filename,mode,*ext1,**ext2):
"""Open the input file, return the HDUList and the extension."""