X-1.0rc2: findAll() fails instead of returning None --- doc updated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
the docs have been updated to clearly describe the current behavior of findAll()
To make findAll() easier to use, a request bug was posted:
bug 779099: [request] findAll() should force getLastMatch() to return None if nothing was found
*** A workaround to avoid a failing findAll():
matches = findAll(img) if exists(img, 0) else ()
for x in matches:
pass # will not execute if nothing found
-------
According to docs, findAll() should return None if images are not found, but it fails instead.
Docs: http://
Command: fields = findAll([image here])
[profile] Finder.findAll START
[profile] Finder.findAll END: 1074ms
[error] Stopped
[error] An error occurs at line 6
[error] Error message: Traceback (most recent call last):
File "C:\Users\
lettu_fields = findAll(
File "C:\SikuliX\
Line 14, in file C:\Users\
at org.sikuli.
at org.sikuli.
at org.python.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
org.
Line 14
, in file C:\Users\
summary: |
- X-1.0rc2: findAll() fails instead of returning None + X-1.0rc2: findAll() fails instead of returning None --- doc to be + updated |
description: | updated |
Changed in sikuli: | |
status: | Confirmed → Fix Committed |
description: | updated |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
Changed in sikuli: | |
status: | Fix Released → Incomplete |
description: | updated |
I will change the docs accordingly, since it is in fact the current behavior.
If you want to have that findAll() returns None instead of failing, you have to use setThrowExcepti on(False) for the respective region (see docs: http:// sikuli. org/docx/ region. html#exception- findfailed)