diff --git a/gwcs/converters/wcs.py b/gwcs/converters/wcs.py index bfaab5bd..313d6d10 100644 --- a/gwcs/converters/wcs.py +++ b/gwcs/converters/wcs.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import warnings +from contextlib import suppress from asdf.extension import Converter @@ -22,7 +23,7 @@ def from_yaml_tree(self, node, tag, ctx): # Ignore the warning about the bounding box order for data read from a # file. This is causing issues with files from MAST. - with warnings.catch_warnings(): + with suppress(AttributeError), warnings.catch_warnings(): warnings.filterwarnings('ignore', category=GwcsBoundingBoxWarning) _ = gwcsobj.bounding_box