Skip to content

Commit 4130dec

Browse files
committed
Squashed commit of the following:
commit 9db931a Author: Dave Amies <[email protected]> Date: Sun Feb 27 10:02:46 2022 +1000 Fix for issue eficode#60 Fix for issue eficode#60 This fix ensures even if timeout is set to 0 (zero) locate is called at least once.
1 parent 76e1a30 commit 4130dec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageHorizonLibrary/recognition/_recognize_images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ def wait_for(self, reference_image, timeout=10):
248248
249249
Returns Python tuple ``(x, y)`` of the coordinates.
250250
'''
251-
stop_time = time() + int(timeout)
251+
stop_time = int(time()) + int(timeout)
252252
location = None
253253
with self._suppress_keyword_on_failure():
254-
while time() < stop_time:
254+
while int(time()) <= stop_time:
255255
try:
256256
location = self._locate(reference_image, log_it=False)
257257
break

0 commit comments

Comments
 (0)