diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-20 19:05:06 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-20 19:05:06 (GMT) |
commit | 226c34a47471c5c27bc9a0c262edd62d713acc81 (patch) | |
tree | a17ce5fe708b05dd585522c5d822a286ac8129d0 /src/engine/SCons/Node | |
parent | 2e74f8c28a15f64bad8429ebece227db285f07dc (diff) | |
download | SCons-226c34a47471c5c27bc9a0c262edd62d713acc81.zip SCons-226c34a47471c5c27bc9a0c262edd62d713acc81.tar.gz SCons-226c34a47471c5c27bc9a0c262edd62d713acc81.tar.bz2 |
Futurize stage 2 2to3 fixes only.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/Alias.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Node/Python.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 16 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/engine/SCons/Node/Alias.py b/src/engine/SCons/Node/Alias.py index a035816..f229a9f 100644 --- a/src/engine/SCons/Node/Alias.py +++ b/src/engine/SCons/Node/Alias.py @@ -89,7 +89,7 @@ class AliasNodeInfo(SCons.Node.NodeInfoBase): """ # TODO check or discard version del state['_version_id'] - for key, value in state.items(): + for key, value in list(state.items()): if key not in ('__weakref__',): setattr(self, key, value) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 71511b5..9b7e105 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1607,7 +1607,7 @@ class Dir(Base): This clears any cached information that is invalidated by changing the repository.""" - for node in self.entries.values(): + for node in list(self.entries.values()): if node != self.dir: if node != self and isinstance(node, Dir): node.__clearRepositoryCache(duplicate) @@ -2179,7 +2179,7 @@ class Dir(Base): for x in excludeList: r = self.glob(x, ondisk, source, strings) excludes.extend(r) - result = filter(lambda x: not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes)), result) + result = [x for x in result if not any(fnmatch.fnmatch(str(x), str(e)) for e in SCons.Util.flatten(excludes))] return sorted(result, key=lambda a: str(a)) def _glob1(self, pattern, ondisk=True, source=False, strings=False): @@ -2203,7 +2203,7 @@ class Dir(Base): # We use the .name attribute from the Node because the keys of # the dir.entries dictionary are normalized (that is, all upper # case) on case-insensitive systems like Windows. - node_names = [ v.name for k, v in dir.entries.items() + node_names = [ v.name for k, v in list(dir.entries.items()) if k not in ('.', '..') ] names.extend(node_names) if not strings: @@ -2481,7 +2481,7 @@ class FileNodeInfo(SCons.Node.NodeInfoBase): """ # TODO check or discard version del state['_version_id'] - for key, value in state.items(): + for key, value in list(state.items()): if key not in ('__weakref__',): setattr(self, key, value) diff --git a/src/engine/SCons/Node/Python.py b/src/engine/SCons/Node/Python.py index f151fc5..92cc320 100644 --- a/src/engine/SCons/Node/Python.py +++ b/src/engine/SCons/Node/Python.py @@ -67,7 +67,7 @@ class ValueNodeInfo(SCons.Node.NodeInfoBase): """ # TODO check or discard version del state['_version_id'] - for key, value in state.items(): + for key, value in list(state.items()): if key not in ('__weakref__',): setattr(self, key, value) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 00ddf2f..2bf38c2 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -382,7 +382,7 @@ class NodeInfoBase(object): try: field_list = self.field_list except AttributeError: - field_list = getattr(self, '__dict__', {}).keys() + field_list = list(getattr(self, '__dict__', {}).keys()) for obj in type(self).mro(): for slot in getattr(obj, '__slots__', ()): if slot not in ('__weakref__', '__dict__'): @@ -427,7 +427,7 @@ class NodeInfoBase(object): # TODO check or discard version del state['_version_id'] - for key, value in state.items(): + for key, value in list(state.items()): if key not in ('__weakref__',): setattr(self, key, value) @@ -488,7 +488,7 @@ class BuildInfoBase(object): """ # TODO check or discard version del state['_version_id'] - for key, value in state.items(): + for key, value in list(state.items()): if key not in ('__weakref__',): setattr(self, key, value) @@ -1338,7 +1338,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): # dictionary patterns I found all ended up using "not in" # internally anyway...) if self.ignore_set: - iter = chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit])) + iter = chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f]) children = [] for i in iter: @@ -1372,7 +1372,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): # using dictionary keys, lose the order, and the only ordered # dictionary patterns I found all ended up using "not in" # internally anyway...) - return list(chain.from_iterable(filter(None, [self.sources, self.depends, self.implicit]))) + return list(chain.from_iterable([_f for _f in [self.sources, self.depends, self.implicit] if _f])) def children(self, scan=1): """Return a list of the node's direct children, minus those @@ -1396,7 +1396,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): def Decider(self, function): foundkey = None - for k, v in _decider_map.iteritems(): + for k, v in _decider_map.items(): if v == function: foundkey = k break @@ -1609,8 +1609,8 @@ class Node(object, with_metaclass(NoSlotsPyPy)): new_bkids = new.bsources + new.bdepends + new.bimplicit new_bkidsigs = new.bsourcesigs + new.bdependsigs + new.bimplicitsigs - osig = dict(zip(old_bkids, old_bkidsigs)) - nsig = dict(zip(new_bkids, new_bkidsigs)) + osig = dict(list(zip(old_bkids, old_bkidsigs))) + nsig = dict(list(zip(new_bkids, new_bkidsigs))) # The sources and dependencies we'll want to report are all stored # as relative paths to this target's directory, but we want to |