Skip to content

Commit

Permalink
[py]: implicitly iterate dictionaries without specifying keys() in …
Browse files Browse the repository at this point in the history
…places
  • Loading branch information
symonk committed Sep 3, 2022
1 parent 6b4b9f8 commit 011e931
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py/selenium/webdriver/firefox/firefox_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def parse_manifest_json(content):
for node in description.childNodes:
# Remove the namespace prefix from the tag for comparison
entry = node.nodeName.replace(em, "")
if entry in details.keys():
if entry in details:
details.update({entry: get_text(node)})
if not details.get('id'):
for i in range(description.attributes.length):
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def create_matches(options: List[BaseOptions]) -> Dict:
always[k] = v

for i in opts:
for k in always.keys():
for k in always:
del i[k]

capabilities["capabilities"]["alwaysMatch"] = always
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/support/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def groups(self) -> Sequence[str]:
return cls(*rgb)
elif m.match(HSL_PATTERN, str_) or m.match(HSLA_PATTERN, str_):
return cls._from_hsl(*m.groups)
elif str_.upper() in Colors.keys():
elif str_.upper() in Colors:
return Colors[str_.upper()]
else:
raise ValueError("Could not convert %s into color" % str_)
Expand Down

0 comments on commit 011e931

Please sign in to comment.