Skip to content

Commit e13da04

Browse files
committed
2to3.py -f dict
1 parent de70bce commit e13da04

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

doc/buildhtml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def setup_publishers(self):
141141
config file settings and command-line options by
142142
`self.get_settings()`.
143143
"""
144-
for name, publisher in self.publishers.items():
144+
for name, publisher in list(self.publishers.items()):
145145
option_parser = OptionParser(
146146
components=publisher.components, read_config_files=1,
147147
usage=usage, description=description)

src/Selenium2Library/keywords/keywordgroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _run_on_failure_decorator(method, *args, **kwargs):
2828
class KeywordGroupMetaClass(type):
2929
def __new__(cls, clsname, bases, dict):
3030
if decorator:
31-
for name, method in dict.items():
31+
for name, method in list(dict.items()):
3232
if not name.startswith('_') and inspect.isroutine(method):
3333
dict[name] = decorator(_run_on_failure_decorator, method)
3434
return type.__new__(cls, clsname, bases, dict)

src/Selenium2Library/locators/elementfinder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self):
2222
'default': self._find_by_default
2323
}
2424
self._strategies = NormalizedDict(initial=strategies, caseless=True, spaceless=True)
25-
self._default_strategies = strategies.keys()
25+
self._default_strategies = list(strategies.keys())
2626

2727
def find(self, browser, locator, tag=None):
2828
assert browser is not None
@@ -190,9 +190,7 @@ def _element_matches(self, element, tag, constraints):
190190
def _filter_elements(self, elements, tag, constraints):
191191
elements = self._normalize_result(elements)
192192
if tag is None: return elements
193-
return filter(
194-
lambda element: self._element_matches(element, tag, constraints),
195-
elements)
193+
return [element for element in elements if self._element_matches(element, tag, constraints)]
196194

197195
def _get_attrs_with_url(self, key_attrs, criteria, browser):
198196
attrs = []

test/lib/mockito/invocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def matches(self, invocation):
4747
return False
4848
if len(self.named_params) != len(invocation.named_params):
4949
return False
50-
if self.named_params.keys() != invocation.named_params.keys():
50+
if list(self.named_params.keys()) != list(invocation.named_params.keys()):
5151
return False
5252

5353
for x, p1 in enumerate(self.params):
5454
if not self.compare(p1, invocation.params[x]):
5555
return False
5656

57-
for x, p1 in self.named_params.iteritems():
57+
for x, p1 in self.named_params.items():
5858
if not self.compare(p1, invocation.named_params[x]):
5959
return False
6060

test/lib/mockito/mock_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def mock_for(self, cls):
1212
return self.mocks.get(cls, None)
1313

1414
def unstub_all(self):
15-
for mock in self.mocks.itervalues():
15+
for mock in self.mocks.values():
1616
mock.unstub()
1717
self.mocks.clear()
1818

test/lib/mockito/mockito.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ArgumentError(Exception):
1515
pass
1616

1717
def _multiple_arguments_in_use(*args):
18-
return len(filter(lambda x: x, args)) > 1
18+
return len([x for x in args if x]) > 1
1919

2020
def _invalid_argument(value):
2121
return (value is not None and value < 1) or value == 0

0 commit comments

Comments
 (0)