From bccc58b04ccf675177a94d7042e78413cf1c1586 Mon Sep 17 00:00:00 2001 From: embray Date: Fri, 24 Feb 2012 15:37:41 +0000 Subject: Don't assume that there are definitely any HISTORY cards. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15285 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/wcsutil/headerlet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/stwcs/wcsutil/headerlet.py') diff --git a/lib/stwcs/wcsutil/headerlet.py b/lib/stwcs/wcsutil/headerlet.py index 6d3be64..c4bfa22 100644 --- a/lib/stwcs/wcsutil/headerlet.py +++ b/lib/stwcs/wcsutil/headerlet.py @@ -1835,8 +1835,9 @@ class Headerlet(pyfits.HDUList): self.fit_kws = ['HDRNAME', 'NMATCH', 'CATALOG'] self.history = '' # header['HISTORY'] returns an iterable of all HISTORY values - for hist in self[0].header['HISTORY']: - self.history += hist + '\n' + if 'HISTORY' in self[0].header: + for hist in self[0].header['HISTORY']: + self.history += hist + '\n' self.d2imerr = 0 self.axiscorr = 1 -- cgit