@@ -150,32 +150,29 @@ def clib_full_names(env=None):
150
150
yield libname
151
151
152
152
153
- def check_libgmt (libgmt ):
153
+ def check_libgmt (libgmt : ctypes . CDLL ):
154
154
"""
155
- Make sure that libgmt was loaded correctly.
155
+ Make sure the GMT shared library was loaded correctly.
156
156
157
- Checks if it defines some common required functions.
158
-
159
- Does nothing if everything is fine. Raises an exception if any of the
160
- functions are missing.
157
+ Checks if the GMT shared library defines a few of the required functions. Does
158
+ nothing if everything is fine. Raises an exception if any of the functions are
159
+ missing.
161
160
162
161
Parameters
163
162
----------
164
- libgmt : :py:class:`ctypes.CDLL`
163
+ libgmt
165
164
A shared library loaded using ctypes.
166
165
167
166
Raises
168
167
------
169
168
GMTCLibError
170
169
"""
171
- # Check if a few of the functions we need are in the library
172
- functions = ["Create_Session" , "Get_Enum" , "Call_Module" , "Destroy_Session" ]
173
- for func in functions :
170
+ for func in ["Create_Session" , "Get_Enum" , "Call_Module" , "Destroy_Session" ]:
174
171
if not hasattr (libgmt , "GMT_" + func ):
175
172
msg = (
176
173
f"Error loading '{ libgmt ._name } '. Couldn't access function GMT_{ func } . "
177
- "Ensure that you have installed an up-to-date GMT version 6 library. "
178
- "Please set the environment variable 'GMT_LIBRARY_PATH' to the "
179
- "directory of the GMT 6 library."
174
+ "Ensure that you have installed an up-to-date GMT version 6 library and "
175
+ "set the environment variable 'GMT_LIBRARY_PATH' to the directory of "
176
+ "the GMT 6 library."
180
177
)
181
178
raise GMTCLibError (msg )
0 commit comments