We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 638ce40 commit 66d4d5cCopy full SHA for 66d4d5c
pygmt/__init__.py
@@ -107,6 +107,7 @@ def show_versions(file=sys.stdout):
107
108
import importlib
109
import platform
110
+ import shutil
111
import subprocess
112
113
from packaging.requirements import Requirement
@@ -141,12 +142,10 @@ def _get_ghostscript_version():
141
142
return None
143
144
for gs_cmd in cmds:
- try:
145
+ if (gsfullpath := shutil.which(gs_cmd)) is not None:
146
return subprocess.check_output(
- [gs_cmd, "--version"], universal_newlines=True
147
+ [gsfullpath, "--version"], universal_newlines=True
148
).strip()
- except FileNotFoundError:
149
- continue
150
151
152
sys_info = {
0 commit comments