summaryrefslogtreecommitdiffstats
path: root/src/script/scons-time.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/scons-time.py')
-rw-r--r--src/script/scons-time.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py
index 4296192..9737dfe 100644
--- a/src/script/scons-time.py
+++ b/src/script/scons-time.py
@@ -29,8 +29,7 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
+from __future__ import division, print_function
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -42,7 +41,6 @@ import shutil
import sys
import tempfile
import time
-import collections
try:
sorted
@@ -456,7 +454,7 @@ class SConsTimer(object):
Each message is prepended with a standard prefix of our name
plus the time.
"""
- if isinstance(msg, collections.Callable):
+ if callable(msg):
msg = msg(*args)
else:
msg = msg % args
@@ -475,7 +473,7 @@ class SConsTimer(object):
The action is called if it's a callable Python function, and
otherwise passed to os.system().
"""
- if isinstance(action, collections.Callable):
+ if callable(action):
action(*args)
else:
os.system(action % args)
@@ -697,7 +695,7 @@ class SConsTimer(object):
sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces)
sys.exit(1)
statistics = pstats.Stats(file).stats
- matches = [ e for e in list(statistics.items()) if e[0][2] == function ]
+ matches = [ e for e in statistics.items() if e[0][2] == function ]
r = matches[0]
return r[0][0], r[0][1], r[0][2], r[1][3]
@@ -1467,7 +1465,7 @@ class SConsTimer(object):
elif o in ('--title',):
self.title = a
elif o in ('--which',):
- if not a in list(self.time_strings.keys()):
+ if not a in self.time_strings.keys():
sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a))
sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name))
sys.exit(1)