Skip to content

Commit 523c7d7

Browse files
committed
quit on exit
1 parent 170b9c6 commit 523c7d7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

autoparaselenium/browsers/chrome.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import atexit
12
import os
23
import stat
34
import subprocess as sb
@@ -38,6 +39,7 @@ def __init__(self, *args, **kwargs):
3839
super().__init__(*args, **kwargs)
3940
sb.Popen = old_popen
4041
self.has_quit = False
42+
atexit.register(self.quit)
4143

4244
def quit(self):
4345
if not self.has_quit:

autoparaselenium/browsers/firefox.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import atexit
12
from contextlib import suppress
23
from functools import partial
34
from pathlib import Path
@@ -12,6 +13,7 @@ class FirefoxDriver(webdriver.Firefox):
1213
def __init__(self, *args, **kwargs):
1314
super().__init__(*args, **kwargs)
1415
self.has_quit = False
16+
atexit.register(self.quit)
1517

1618
def quit(self):
1719
if not self.has_quit:

0 commit comments

Comments
 (0)