Skip to content

Commit a3ccf4a

Browse files
authored
chore: use ChainMap for dict override (microsoft#1877)
1 parent f4a68cd commit a3ccf4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

playwright/_impl/_locator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import json
1616
import pathlib
1717
import sys
18+
from collections import ChainMap
1819
from typing import (
1920
TYPE_CHECKING,
2021
Any,
@@ -519,7 +520,7 @@ async def screenshot(
519520
params = locals_to_params(locals())
520521
return await self._with_element(
521522
lambda h, timeout: h.screenshot(
522-
**{**params, "timeout": timeout}, # type: ignore
523+
**ChainMap({"timeout": timeout}, params),
523524
),
524525
)
525526

@@ -552,7 +553,10 @@ async def select_option(
552553
async def select_text(self, force: bool = None, timeout: float = None) -> None:
553554
params = locals_to_params(locals())
554555
return await self._with_element(
555-
lambda h, timeout: h.select_text(**{**params, "timeout": timeout}), timeout # type: ignore
556+
lambda h, timeout: h.select_text(
557+
**ChainMap({"timeout": timeout}, params),
558+
),
559+
timeout,
556560
)
557561

558562
async def set_input_files(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy