Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle missing astropy in _open_impl #562

Merged
merged 2 commits into from
Oct 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions asdf/asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,14 @@ def _open_impl(cls, self, fd, uri=None, mode='r',
ignore_missing_extensions=ignore_missing_extensions,
_extension_metadata=self._extension_metadata)
except ValueError:
pass
raise ValueError(
"Input object does not appear to be ASDF file or FITS with " +
"ASDF extension")
raise ValueError(
"Input object does not appear to be an ASDF file or a FITS with " +
"ASDF extension") from None
except ImportError:
raise ValueError(
"Input object does not appear to be an ASDF file. Cannot check " +
"if it is a FITS with ASDF extension because 'astropy' is not " +
"installed") from None
return cls._open_asdf(self, fd, uri=uri, mode=mode,
validate_checksums=validate_checksums,
do_not_fill_defaults=do_not_fill_defaults,
Expand Down