Skip to content

Commit 11bfefa

Browse files
committed
tweak arguments
1 parent a9aefe9 commit 11bfefa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

appium/webdriver/appium_connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ class AppiumConnection(RemoteConnection):
3535
def __init__(
3636
self,
3737
remote_server_addr: str,
38-
keep_alive: bool = True,
38+
keep_alive: Optional[bool] = True,
3939
ignore_proxy: Optional[bool] = False,
4040
init_args_for_pool_manager: Union[Dict[str, Any], None] = None,
4141
client_config: Optional[ClientConfig] = None,
4242
):
4343
if client_config is None:
4444
client_config = ClientConfig(remote_server_addr=remote_server_addr)
45-
client_config.keep_alive = keep_alive
45+
if keep_alive is not None:
46+
client_config.keep_alive = keep_alive
4647
if ignore_proxy is not None:
4748
client_config.ignore_proxy = ignore_proxy
4849
if init_args_for_pool_manager is not None:

appium/webdriver/webdriver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,11 @@ def __init__( # noqa: PLR0913
217217
client_config: Optional[ClientConfig] = None,
218218
):
219219
if isinstance(command_executor, str):
220-
command_executor = AppiumConnection(command_executor, keep_alive=keep_alive)
221-
222-
if client_config is None:
223-
client_config = ClientConfig(remote_server_addr=command_executor, ignore_certificates=not strict_ssl)
220+
client_config = client_config or ClientConfig(
221+
remote_server_addr=command_executor, keep_alive=keep_alive, ignore_certificates=not strict_ssl
222+
)
223+
client_config.remote_server_addr = command_executor
224+
command_executor = AppiumConnection(remote_server_addr=command_executor, client_config=client_config)
224225

225226
super().__init__(
226227
command_executor=command_executor,

0 commit comments

Comments
 (0)