Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions py/selenium/webdriver/chrome/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.


from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.types import SubprocessStdAlias
from selenium.webdriver.chromium import service
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/chromium/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# specific language governing permissions and limitations
# under the License.

from collections.abc import Mapping
from collections.abc import Mapping, Sequence
from io import IOBase
from typing import Optional, Sequence
from typing import Optional

from selenium.types import SubprocessStdAlias
from selenium.webdriver.common import service
Expand Down
28 changes: 14 additions & 14 deletions py/selenium/webdriver/common/bidi/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

from dataclasses import dataclass
from typing import Any, Dict, List, Optional
from typing import Any, Optional

from selenium.webdriver.common.bidi.common import command_builder

Expand Down Expand Up @@ -55,7 +55,7 @@ class RealmInfo:
sandbox: Optional[str] = None

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "RealmInfo":
def from_json(cls, json: dict[str, Any]) -> "RealmInfo":
"""Creates a RealmInfo instance from a dictionary.

Parameters:
Expand Down Expand Up @@ -90,7 +90,7 @@ class Source:
context: Optional[str] = None

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "Source":
def from_json(cls, json: dict[str, Any]) -> "Source":
"""Creates a Source instance from a dictionary.

Parameters:
Expand Down Expand Up @@ -120,7 +120,7 @@ class EvaluateResult:
exception_details: Optional[dict] = None

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "EvaluateResult":
def from_json(cls, json: dict[str, Any]) -> "EvaluateResult":
"""Creates an EvaluateResult instance from a dictionary.

Parameters:
Expand Down Expand Up @@ -155,7 +155,7 @@ def __init__(self, channel: str, data: dict, source: Source):
self.source = source

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "ScriptMessage":
def from_json(cls, json: dict[str, Any]) -> "ScriptMessage":
"""Creates a ScriptMessage instance from a dictionary.

Parameters:
Expand Down Expand Up @@ -189,7 +189,7 @@ def __init__(self, realm_info: RealmInfo):
self.realm_info = realm_info

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "RealmCreated":
def from_json(cls, json: dict[str, Any]) -> "RealmCreated":
"""Creates a RealmCreated instance from a dictionary.

Parameters:
Expand All @@ -212,7 +212,7 @@ def __init__(self, realm: str):
self.realm = realm

@classmethod
def from_json(cls, json: Dict[str, Any]) -> "RealmDestroyed":
def from_json(cls, json: dict[str, Any]) -> "RealmDestroyed":
"""Creates a RealmDestroyed instance from a dictionary.

Parameters:
Expand Down Expand Up @@ -262,9 +262,9 @@ def remove_console_message_handler(self, id):
def _add_preload_script(
self,
function_declaration: str,
arguments: Optional[List[Dict[str, Any]]] = None,
contexts: Optional[List[str]] = None,
user_contexts: Optional[List[str]] = None,
arguments: Optional[list[dict[str, Any]]] = None,
contexts: Optional[list[str]] = None,
user_contexts: Optional[list[str]] = None,
sandbox: Optional[str] = None,
) -> str:
"""Adds a preload script.
Expand All @@ -288,7 +288,7 @@ def _add_preload_script(
if contexts is not None and user_contexts is not None:
raise ValueError("Cannot specify both contexts and user_contexts")

params: Dict[str, Any] = {"functionDeclaration": function_declaration}
params: dict[str, Any] = {"functionDeclaration": function_declaration}

if arguments is not None:
params["arguments"] = arguments
Expand All @@ -312,7 +312,7 @@ def _remove_preload_script(self, script_id: str) -> None:
params = {"script": script_id}
self.conn.execute(command_builder("script.removePreloadScript", params))

def _disown(self, handles: List[str], target: dict) -> None:
def _disown(self, handles: list[str], target: dict) -> None:
"""Disowns the given handles.

Parameters:
Expand All @@ -331,7 +331,7 @@ def _call_function(
function_declaration: str,
await_promise: bool,
target: dict,
arguments: Optional[List[dict]] = None,
arguments: Optional[list[dict]] = None,
result_ownership: Optional[str] = None,
serialization_options: Optional[dict] = None,
this: Optional[dict] = None,
Expand Down Expand Up @@ -416,7 +416,7 @@ def _get_realms(
self,
context: Optional[str] = None,
type: Optional[str] = None,
) -> List[RealmInfo]:
) -> list[RealmInfo]:
"""Returns a list of all realms, optionally filtered.

Parameters:
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/edge/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.types import SubprocessStdAlias
from selenium.webdriver.chromium import service
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/firefox/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.types import SubprocessStdAlias
from selenium.webdriver.common import service, utils
Expand Down
3 changes: 2 additions & 1 deletion py/selenium/webdriver/ie/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from typing import Optional, Sequence
from collections.abc import Sequence
from typing import Optional

from selenium.types import SubprocessStdAlias
from selenium.webdriver.common import service
Expand Down
12 changes: 6 additions & 6 deletions py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from base64 import b64decode, urlsafe_b64encode
from contextlib import asynccontextmanager, contextmanager
from importlib import import_module
from typing import Any, Dict, Optional, Type, Union, cast
from typing import Any, Optional, Union, cast

from selenium.common.exceptions import (
InvalidArgumentException,
Expand Down Expand Up @@ -136,7 +136,7 @@ def get_remote_connection(


def create_matches(options: list[BaseOptions]) -> dict:
capabilities: Dict[str, Any] = {"capabilities": {}}
capabilities: dict[str, Any] = {"capabilities": {}}
opts = []
for opt in options:
opts.append(opt.to_capabilities())
Expand Down Expand Up @@ -201,7 +201,7 @@ def __init__(
file_detector: Optional[FileDetector] = None,
options: Optional[Union[BaseOptions, list[BaseOptions]]] = None,
locator_converter: Optional[LocatorConverter] = None,
web_element_cls: Optional[Type[WebElement]] = None,
web_element_cls: Optional[type[WebElement]] = None,
client_config: Optional[ClientConfig] = None,
) -> None:
"""Create a new driver that will issue commands using the wire
Expand Down Expand Up @@ -248,8 +248,8 @@ def __init__(
)
self._is_remote = True
self.session_id: Optional[str] = None
self.caps: Dict[str, Any] = {}
self.pinned_scripts: Dict[str, Any] = {}
self.caps: dict[str, Any] = {}
self.pinned_scripts: dict[str, Any] = {}
self.error_handler = ErrorHandler()
self._switch_to = SwitchTo(self)
self._mobile = Mobile(self)
Expand Down Expand Up @@ -668,7 +668,7 @@ def print_page(self, print_options: Optional[PrintOptions] = None) -> str:
--------
>>> driver.print_page()
"""
options: Union[Dict[str, Any], Any] = {}
options: Union[dict[str, Any], Any] = {}
if print_options:
options = print_options.to_dict()

Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/safari/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.webdriver.common import service

Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/webkitgtk/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import shutil
import warnings
from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.webdriver.common import service

Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/wpewebkit/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.

import shutil
from collections.abc import Mapping
from typing import Optional, Sequence
from collections.abc import Mapping, Sequence
from typing import Optional

from selenium.webdriver.common import service

Expand Down
Loading