diff --git a/gwcs/converters/wcs.py b/gwcs/converters/wcs.py index bfaab5bd..96f1a94e 100644 --- a/gwcs/converters/wcs.py +++ b/gwcs/converters/wcs.py @@ -1,7 +1,9 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- +from ast import Attribute import warnings +from contextlib import suppress from asdf.extension import Converter @@ -22,7 +24,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