diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-29 05:50:15 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-29 05:50:15 (GMT) |
commit | 7adebb06bb6055345cc584377159d8052ea39e1b (patch) | |
tree | d0ca5f58b87d964927a1db7f4fe8a602f8405d23 /src/engine/SCons/Node | |
parent | 59ed0a109bf5add2efcef459080837b11066c6fb (diff) | |
download | SCons-7adebb06bb6055345cc584377159d8052ea39e1b.zip SCons-7adebb06bb6055345cc584377159d8052ea39e1b.tar.gz SCons-7adebb06bb6055345cc584377159d8052ea39e1b.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Accumulated small fixers: renames, next, zip, and intern.
Files that were modified or added while developing on branches/pending didn't
have the fixers previously applied. This patchset picks up those.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 38 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 4 |
3 files changed, 22 insertions, 22 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index e5b8147..4e455da 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -647,7 +647,7 @@ class Base(SCons.Node.Node): return self._memo['_save_str'] except KeyError: pass - result = intern(self._get_str()) + result = sys.intern(self._get_str()) self._memo['_save_str'] = result return result diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 6b76e9a..9c5973c 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -1101,22 +1101,22 @@ class NodeTestCase(unittest.TestCase): nw = SCons.Node.Walker(n1) assert not nw.is_done() - assert nw.next().name == "n1" + assert nw.get_next().name == "n1" assert nw.is_done() - assert nw.next() is None + assert nw.get_next() is None n2 = MyNode("n2") n3 = MyNode("n3") n1.add_source([n2, n3]) nw = SCons.Node.Walker(n1) - n = nw.next() + n = nw.get_next() assert n.name == "n2", n.name - n = nw.next() + n = nw.get_next() assert n.name == "n3", n.name - n = nw.next() + n = nw.get_next() assert n.name == "n1", n.name - n = nw.next() + n = nw.get_next() assert n is None, n n4 = MyNode("n4") @@ -1127,17 +1127,17 @@ class NodeTestCase(unittest.TestCase): n3.add_dependency([n6, n7]) nw = SCons.Node.Walker(n1) - assert nw.next().name == "n4" - assert nw.next().name == "n5" + assert nw.get_next().name == "n4" + assert nw.get_next().name == "n5" assert n2 in nw.history - assert nw.next().name == "n2" - assert nw.next().name == "n6" - assert nw.next().name == "n7" + assert nw.get_next().name == "n2" + assert nw.get_next().name == "n6" + assert nw.get_next().name == "n7" assert n3 in nw.history - assert nw.next().name == "n3" + assert nw.get_next().name == "n3" assert n1 in nw.history - assert nw.next().name == "n1" - assert nw.next() is None + assert nw.get_next().name == "n1" + assert nw.get_next() is None n8 = MyNode("n8") n8.add_dependency([n3]) @@ -1150,16 +1150,16 @@ class NodeTestCase(unittest.TestCase): global cycle_detected nw = SCons.Node.Walker(n3, cycle_func = cycle) - n = nw.next() + n = nw.get_next() assert n.name == "n6", n.name - n = nw.next() + n = nw.get_next() assert n.name == "n8", n.name assert cycle_detected cycle_detected = None - n = nw.next() + n = nw.get_next() assert n.name == "n7", n.name - n = nw.next() - assert nw.next() is None + n = nw.get_next() + assert nw.get_next() is None def test_abspath(self): """Test the get_abspath() method.""" diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 455487e..d7846c5 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1276,7 +1276,7 @@ class Walker: This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and - returns the next node on the descent with each next() call. + returns the next node on the descent with each get_next() call. 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called @@ -1296,7 +1296,7 @@ class Walker: self.history = {} # used to efficiently detect and avoid cycles self.history[node] = None - def next(self): + def get_next(self): """Return the next node for this walk of the tree. This function is intentionally iterative, not recursive, |