16
16
# under the License.
17
17
18
18
import http .client as http_client
19
- import warnings
20
19
21
20
from selenium .common .exceptions import WebDriverException
22
21
from selenium .webdriver .remote .webdriver import WebDriver as RemoteWebDriver
@@ -32,7 +31,6 @@ class WebDriver(RemoteWebDriver):
32
31
33
32
def __init__ (
34
33
self ,
35
- reuse_service = False ,
36
34
keep_alive = True ,
37
35
options : Options = None ,
38
36
service : Service = None ,
@@ -41,26 +39,17 @@ def __init__(
41
39
safaridriver service.
42
40
43
41
:Args:
44
- - reuse_service - If True, do not spawn a safaridriver instance; instead, connect to an already-running service that was launched externally.
45
42
- keep_alive - Whether to configure SafariRemoteConnection to use
46
43
HTTP keep-alive. Defaults to True.
47
44
- options - Instance of ``options.Options``.
48
45
- service - Service object for handling the browser driver if you need to pass extra details
49
46
"""
50
- if reuse_service :
51
- warnings .warn (
52
- "reuse_service has been deprecated, please use the Service class to set it" ,
53
- DeprecationWarning ,
54
- stacklevel = 2 ,
55
- )
56
-
57
47
self .service = service if service else Service ()
58
48
options = options if options else Options ()
59
49
60
50
self .service .path = DriverFinder .get_path (self .service , options )
61
51
62
- self ._reuse_service = reuse_service and self .service .reuse_service
63
- if not self ._reuse_service :
52
+ if not self .service .reuse_service :
64
53
self .service .start ()
65
54
66
55
executor = SafariRemoteConnection (
@@ -81,7 +70,7 @@ def quit(self):
81
70
except http_client .BadStatusLine :
82
71
pass
83
72
finally :
84
- if not self ._reuse_service :
73
+ if not self .service . reuse_service :
85
74
self .service .stop ()
86
75
87
76
# safaridriver extension commands. The canonical command support matrix is here:
0 commit comments