Skip to content

Commit a40f5d6

Browse files
authored
Enable execution in Docker environments (#20)
1 parent 14b103b commit a40f5d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

html2print/html2print.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
class ChromeDriverManager:
4040
def get_chrome_driver(self, path_to_cache_dir: str):
4141
chrome_version = self.get_chrome_version()
42+
43+
# If Web Driver Manager cannot detect Chrome, it returns None.
44+
if chrome_version is None:
45+
raise RuntimeError(
46+
"html2print: "
47+
"Web Driver Manager could not detect an existing Chrome installation."
48+
)
49+
4250
chrome_major_version = chrome_version.split(".")[0]
4351

4452
print( # noqa: T201

0 commit comments

Comments
 (0)