def update_hdu_list(self, rebuild=True):
if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>rebuild = True<EOL><DEDENT>if rebuild:<EOL><INDENT>self.hdu_list = []<EOL>self.hdu_map = {}<EOL>ext_start = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>ext_start = len(self)<EOL><DEDENT>ext = ext_start<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>self._append_hdu_info(ext)<EOL><DEDENT>except IOError:<EOL><INDENT>break<EOL><DEDENT>except RuntimeError:<EOL><INDENT>break<EOL><DEDENT>ext = ext + <NUM_LIT:1><EOL><DEDENT>
Force an update of the entire HDU list

Normally you don't need to call this method directly

if rebuild is false or the hdu_list is not yet set, the list is
rebuilt from scratch