Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ab4db2

Browse files
authored
chore: fix type warnings on windows (#2840)
1 parent85a57cd commit9ab4db2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

‎playwright/_impl/_browser_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _user_data_dir(self, userDataDir: Optional[Union[str, Path]]) -> str:
171171
# Can be dropped once we drop Python 3.9 support (10/2025):
172172
# https://github.com/python/cpython/issues/82852
173173
ifsys.platform=="win32"andsys.version_info[:2]< (3,10):
174-
returnpathlib.Path.cwd()/userDataDir
174+
returnstr(pathlib.Path.cwd()/userDataDir)
175175
returnstr(Path(userDataDir).resolve())
176176
returnstr(Path(userDataDir))
177177

‎tests/common/test_signals.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
def_test_signals_async(
2828
browser_name:str,launch_arguments:Dict,wait_queue:"multiprocessing.Queue[str]"
2929
)->None:
30+
# On Windows, hint to mypy and pyright that they shouldn't check this function
31+
ifsys.platform=="win32":
32+
return
33+
3034
os.setpgrp()
3135
sigint_received=False
3236

@@ -67,6 +71,10 @@ async def main() -> None:
6771
def_test_signals_sync(
6872
browser_name:str,launch_arguments:Dict,wait_queue:"multiprocessing.Queue[str]"
6973
)->None:
74+
# On Windows, hint to mypy and pyright that they shouldn't check this function
75+
ifsys.platform=="win32":
76+
return
77+
7078
os.setpgrp()
7179
sigint_received=False
7280

@@ -103,6 +111,10 @@ def my_sig_handler(signum: int, frame: Any) -> None:
103111
def_create_signals_test(
104112
target:Any,browser_name:str,launch_arguments:Dict
105113
)->None:
114+
# On Windows, hint to mypy and pyright that they shouldn't check this function
115+
ifsys.platform=="win32":
116+
return
117+
106118
wait_queue:"multiprocessing.Queue[str]"=multiprocessing.Queue()
107119
process=multiprocessing.Process(
108120
target=target,args=[browser_name,launch_arguments,wait_queue]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp