Skip to content

Commit 011e931

Browse files
committed
[py]: implicitly iterate dictionaries without specifying keys() in places
1 parent 6b4b9f8 commit 011e931

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

py/selenium/webdriver/firefox/firefox_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def parse_manifest_json(content):
345345
for node in description.childNodes:
346346
# Remove the namespace prefix from the tag for comparison
347347
entry = node.nodeName.replace(em, "")
348-
if entry in details.keys():
348+
if entry in details:
349349
details.update({entry: get_text(node)})
350350
if not details.get('id'):
351351
for i in range(description.attributes.length):

py/selenium/webdriver/remote/webdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def create_matches(options: List[BaseOptions]) -> Dict:
160160
always[k] = v
161161

162162
for i in opts:
163-
for k in always.keys():
163+
for k in always:
164164
del i[k]
165165

166166
capabilities["capabilities"]["alwaysMatch"] = always

py/selenium/webdriver/support/color.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def groups(self) -> Sequence[str]:
9898
return cls(*rgb)
9999
elif m.match(HSL_PATTERN, str_) or m.match(HSLA_PATTERN, str_):
100100
return cls._from_hsl(*m.groups)
101-
elif str_.upper() in Colors.keys():
101+
elif str_.upper() in Colors:
102102
return Colors[str_.upper()]
103103
else:
104104
raise ValueError("Could not convert %s into color" % str_)

0 commit comments

Comments
 (0)