Skip to content

Commit 66fb46b

Browse files
committed
fix linting
1 parent 0a33c1c commit 66fb46b

File tree

1 file changed

+5
-3
lines changed
  • robocorp-code/src/robocorp_code/inspector/java/robocorp_java

1 file changed

+5
-3
lines changed

robocorp-code/src/robocorp_code/inspector/java/robocorp_java/_locators.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,22 @@ def _parse_locator(locator: str, strict_default=False):
2727
lvl_search = []
2828
strict_mode = strict_default
2929
for condition in conditions:
30-
parts: Sequence[str | int] = condition.split(":", 1)
30+
parts: Sequence[str] = condition.split(":", 1)
31+
name: str = parts[0] if len(parts) > 0 else ''
32+
value: Union[str, int] = parts[1] if len(parts) > 1 else ''
3133
if len(parts) == 1:
3234
parts = ["name", parts[0]]
3335
elif parts[0].lower() == "strict":
3436
strict_mode = bool(parts[1])
3537
continue
3638
elif parts[0] in IntegerLocatorTypes:
3739
try:
38-
parts[1] = int(parts[1])
40+
value = int(parts[1])
3941
except ValueError as err:
4042
raise Exception(
4143
"Locator '%s' needs to be of 'integer' type" % parts[0]
4244
) from err
43-
lvl_search.append(SearchElement(parts[0], parts[1], strict=strict_mode))
45+
lvl_search.append(SearchElement(name, value, strict=strict_mode))
4446
searches.append(lvl_search)
4547
return searches
4648

0 commit comments

Comments
 (0)