Skip to content

Commit 4e85cf0

Browse files
authored
Merge branch 'trunk' into py-cdp-logging
2 parents 5e875b8 + b01041f commit 4e85cf0

File tree

1 file changed

+2
-2
lines changed
  • py/selenium/webdriver/support

1 file changed

+2
-2
lines changed

py/selenium/webdriver/support/wait.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def until(self, method: Callable[[D], Union[Literal[False], T]], message: str =
9999
except self._ignored_exceptions as exc:
100100
screen = getattr(exc, "screen", None)
101101
stacktrace = getattr(exc, "stacktrace", None)
102-
time.sleep(self._poll)
103102
if time.monotonic() > end_time:
104103
break
104+
time.sleep(self._poll)
105105
raise TimeoutException(message, screen, stacktrace)
106106

107107
def until_not(self, method: Callable[[D], T], message: str = "") -> Union[T, Literal[True]]:
@@ -122,7 +122,7 @@ def until_not(self, method: Callable[[D], T], message: str = "") -> Union[T, Lit
122122
return value
123123
except self._ignored_exceptions:
124124
return True
125-
time.sleep(self._poll)
126125
if time.monotonic() > end_time:
127126
break
127+
time.sleep(self._poll)
128128
raise TimeoutException(message)

0 commit comments

Comments
 (0)