diff options
| author | William Deegan <bill@baddogconsulting.com> | 2013-10-28 02:04:46 (GMT) |
|---|---|---|
| committer | William Deegan <bill@baddogconsulting.com> | 2013-10-28 02:04:46 (GMT) |
| commit | e38f59cab5d40f09f15c5e65645aa2d8af165c66 (patch) | |
| tree | d50c9d77698c3a82fcc4b64a5ff61b79c20a76f2 /src/engine/SCons/Node | |
| parent | e7888b15628b09af093621825b78df5cbcead088 (diff) | |
| parent | 2be0f31b80087974b5e6d53e12542637636a2253 (diff) | |
| download | SCons-e38f59cab5d40f09f15c5e65645aa2d8af165c66.zip SCons-e38f59cab5d40f09f15c5e65645aa2d8af165c66.tar.gz SCons-e38f59cab5d40f09f15c5e65645aa2d8af165c66.tar.bz2 | |
Merged in dirkbaechle/scons (pull request #92)
Fix: now counting instances only when requested via --debug=count (#2922)
Diffstat (limited to 'src/engine/SCons/Node')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 11 | ||||
| -rw-r--r-- | src/engine/SCons/Node/__init__.py | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 4381697..18400e8 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -44,6 +44,7 @@ import time import codecs import SCons.Action +import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Memoize @@ -581,7 +582,7 @@ class Base(SCons.Node.Node): our relative and absolute paths, identify our parent directory, and indicate that this node should use signatures.""" - if __debug__: logInstanceCreation(self, 'Node.FS.Base') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base') SCons.Node.Node.__init__(self) # Filenames and paths are probably reused and are intern'ed to @@ -1111,7 +1112,7 @@ class FS(LocalFS): The path argument must be a valid absolute path. """ - if __debug__: logInstanceCreation(self, 'Node.FS') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS') self._memo = {} @@ -1445,7 +1446,7 @@ class Dir(Base): BuildInfo = DirBuildInfo def __init__(self, name, directory, fs): - if __debug__: logInstanceCreation(self, 'Node.FS.Dir') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Dir') Base.__init__(self, name, directory, fs) self._morph() @@ -2113,7 +2114,7 @@ class RootDir(Dir): this directory. """ def __init__(self, drive, fs): - if __debug__: logInstanceCreation(self, 'Node.FS.RootDir') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir') # We're going to be our own parent directory (".." entry and .dir # attribute) so we have to set up some values so Base.__init__() # won't gag won't it calls some of our methods. @@ -2361,7 +2362,7 @@ class File(Base): "Directory %s found where file expected.") def __init__(self, name, directory, fs): - if __debug__: logInstanceCreation(self, 'Node.FS.File') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File') Base.__init__(self, name, directory, fs) self._morph() diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 992284d..c114281 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -47,6 +47,7 @@ import collections import copy from itertools import chain +import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Executor import SCons.Memoize @@ -183,7 +184,7 @@ class Node(object): pass def __init__(self): - if __debug__: logInstanceCreation(self, 'Node.Node') + if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.Node') # Note that we no longer explicitly initialize a self.builder # attribute to None here. That's because the self.builder # attribute may be created on-the-fly later by a subclass (the |
