From 4c7ace523dcef8f022d16bf9ea09eddfe1824cfd Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 31 Oct 2017 21:30:59 +0800 Subject: astro/fitscube.py: Fix header property handling --- astro/fits/fitscube.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'astro/fits') diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py index 7a03a06..65b410c 100755 --- a/astro/fits/fitscube.py +++ b/astro/fits/fitscube.py @@ -100,10 +100,9 @@ class FITSCube: @property def header(self): - try: - return self.header_ - except AttributeError: - return fits.Header() + if not hasattr(self, "header_"): + self.header_ = fits.Header() + return self.header_ @header.setter def header(self, value): -- cgit v1.2.2