Skip to content

Commit 2ea9026

Browse files
[py] PEP 484 type hints for selenium.webdriver.remote.file_detector (#9606)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com> Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk>
1 parent 223a4f6 commit 2ea9026

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

py/selenium/webdriver/remote/file_detector.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
from abc import ABCMeta, abstractmethod
1919
import os
20+
from typing import Optional
2021
from selenium.webdriver.common.utils import keys_to_typing
22+
from selenium.types import AnyKey
2123

2224

2325
class FileDetector(metaclass=ABCMeta):
@@ -27,16 +29,16 @@ class FileDetector(metaclass=ABCMeta):
2729
"""
2830

2931
@abstractmethod
30-
def is_local_file(self, *keys):
31-
return
32+
def is_local_file(self, *keys: AnyKey) -> Optional[str]:
33+
return None
3234

3335

3436
class UselessFileDetector(FileDetector):
3537
"""
3638
A file detector that never finds anything.
3739
"""
3840

39-
def is_local_file(self, *keys):
41+
def is_local_file(self, *keys: AnyKey) -> Optional[str]:
4042
return None
4143

4244

@@ -45,7 +47,7 @@ class LocalFileDetector(FileDetector):
4547
Detects files on the local disk.
4648
"""
4749

48-
def is_local_file(self, *keys):
50+
def is_local_file(self, *keys: AnyKey) -> Optional[str]:
4951
file_path = ''.join(keys_to_typing(keys))
5052

5153
if not file_path:

0 commit comments

Comments
 (0)