Fix scons failing when not building sources

This commit is contained in:
Marcelo Fernandez 2017-08-03 11:53:16 -03:00
parent 056b5f9e56
commit 6adeeeb848
1 changed files with 3 additions and 2 deletions

View File

@ -461,7 +461,8 @@ screen = sys.stdout
node_count = 0 node_count = 0
node_count_max = 0 node_count_max = 0
node_count_interval = 1 node_count_interval = 1
node_count_fname = str(env.Dir('#')) + '/.scons_node_count' if ('env' in locals()):
node_count_fname = str(env.Dir('#')) + '/.scons_node_count'
def progress_function(node): def progress_function(node):
global node_count, node_count_max, node_count_interval, node_count_fname global node_count, node_count_max, node_count_interval, node_count_fname
@ -481,7 +482,7 @@ def progress_finish(target, source, env):
with open(node_count_fname, 'w') as f: with open(node_count_fname, 'w') as f:
f.write('%d\n' % node_count) f.write('%d\n' % node_count)
if (env["progress"] == "yes"): if ('env' in locals() and env["progress"] == "yes"):
try: try:
with open(node_count_fname) as f: with open(node_count_fname) as f:
node_count_max = int(f.readline()) node_count_max = int(f.readline())