We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20fb45b commit ac268a1Copy full SHA for ac268a1
py/selenium/webdriver/remote/file_detector.py
@@ -17,6 +17,7 @@
17
18
from abc import ABCMeta
19
from abc import abstractmethod
20
+from contextlib import suppress
21
from pathlib import Path
22
from typing import Optional
23
@@ -45,5 +46,6 @@ class LocalFileDetector(FileDetector):
45
46
47
def is_local_file(self, *keys: AnyKey) -> Optional[str]:
48
file_path = "".join(keys_to_typing(keys))
- path = Path(file_path)
49
- return file_path if path.is_file() else None
+ with suppress(OSError):
50
+ return Path(file_path).is_file()
51
+
0 commit comments