Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 71cf876

Browse files
committed
simplify Fixup gs import
1 parent 91ccf38 commit 71cf876

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

camelot/backends/ghostscript_backend.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ def installed_windows():
1717

1818
class GhostscriptBackend:
1919
def installed(self):
20-
if sys.platform in ["linux", "darwin"]:
21-
return installed_posix()
22-
elif sys.platform == "win32":
23-
return installed_windows()
24-
else:
25-
return installed_posix()
20+
try:
21+
import ghostscript
22+
except RuntimeError:
23+
return None
24+
return not None
25+
26+
2627

2728
def convert(self, pdf_path, png_path, resolution=300):
2829
if not self.installed():

0 commit comments

Comments
 (0)