Skip to content

Commit

Permalink
[py]: Fix issue with LocalFileDetector returning the path for files…
Browse files Browse the repository at this point in the history
… that do not exist
  • Loading branch information
symonk committed Aug 9, 2023
1 parent 95d6217 commit ca32031
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/selenium/webdriver/remote/file_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class LocalFileDetector(FileDetector):

def is_local_file(self, *keys: AnyKey) -> Optional[str]:
file_path = "".join(keys_to_typing(keys))

with suppress(OSError):
_ = Path(file_path).is_file()
return file_path
if Path(file_path).is_file():
return file_path

0 comments on commit ca32031

Please sign in to comment.