Skip to content

Using LibGMT in 'with' fails if GMT < 6.0.0 - #175

Merged
leouieda merged 2 commits into
masterfrom
fail-if-not-gmt6
Apr 24, 2018
Merged

leouieda merged 2 commits into
masterfrom
fail-if-not-gmt6

Conversation

@leouieda

Copy link
Copy Markdown
Member

Uses the new LibGMT.info to check if GMT is at least 6.0.0. Raises a
GMTVersionError exception if it's not.

It would be great if we could check this upon instantiation but that
wouldn't work because LibGMT.get_default requires an active session.
So the only logical place to put this is in LibGMT.__enter__ after the
session is created. The session is closed before the exception is
raised.

Fixes #171

Uses the new LibGMT.info to check if GMT is at least 6.0.0. Raises a
GMTVersionError exception if it's not.

It would be great if we could check this upon instantiation but that
wouldn't work because `LibGMT.get_default` requires an active session.
So the only logical place to put this is in `LibGMT.__enter__` after the
session is created. The session is closed before the exception is
raised.

Fixes #171
@leouieda
leouieda merged commit 1a569d3 into master Apr 24, 2018
@leouieda
leouieda deleted the fail-if-not-gmt6 branch April 24, 2018 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check the GMT version before creating a session

1 participant