Skip to content

Commit 52e2c60

Browse files
committed
remove possible redundant init
1 parent 78e5609 commit 52e2c60

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

appium/webdriver/appium_connection.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
# limitations under the License.
1414

1515
import uuid
16-
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
16+
from typing import TYPE_CHECKING, Any, Dict
1717

18-
from selenium.webdriver.remote.client_config import ClientConfig
1918
from selenium.webdriver.remote.remote_connection import RemoteConnection
2019

2120
from appium.common.helper import library_version
@@ -30,26 +29,17 @@
3029

3130

3231
class AppiumConnection(RemoteConnection):
33-
RemoteConnection.user_agent = f'{PREFIX_HEADER}{library_version()} ({RemoteConnection.user_agent})'
32+
"""
33+
A subclass of selenium.webdriver.remote.remote_connection.Remoteconnection.
3434
35-
def __init__(
36-
self,
37-
remote_server_addr: str,
38-
keep_alive: Optional[bool] = False,
39-
ignore_proxy: Optional[bool] = False,
40-
init_args_for_pool_manager: Union[Dict[str, Any], None] = None,
41-
client_config: Optional[ClientConfig] = None,
42-
):
43-
if client_config is None:
44-
client_config = ClientConfig(remote_server_addr=remote_server_addr)
45-
if keep_alive is not None:
46-
client_config.keep_alive = keep_alive
47-
if ignore_proxy is not None:
48-
client_config.ignore_proxy = ignore_proxy
49-
if init_args_for_pool_manager is not None:
50-
client_config.init_args_for_pool_manager = init_args_for_pool_manager
35+
The changes are:
36+
- The default user agent
37+
- Adds 'X-Idempotency-Key' header in a new session request to avoid proceeding
38+
the same request multiple times in the Appium server side.
39+
- https://github.com/appium/appium-base-driver/pull/400
40+
"""
5141

52-
super().__init__(client_config=client_config)
42+
RemoteConnection.user_agent = f'{PREFIX_HEADER}{library_version()} ({RemoteConnection.user_agent})'
5343

5444
@classmethod
5545
def get_remote_connection_headers(cls, parsed_url: 'ParseResult', keep_alive: bool = True) -> Dict[str, Any]:

0 commit comments

Comments
 (0)