summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2017-08-03 11:53:16 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2017-08-03 11:53:16 -0300
commit6adeeeb8488f9d2fd0bff182fc8c757b5d19cf76 (patch)
tree8696b23307f752d45b2fed0edaa46e8cf3e87d85
parent056b5f9e56e6abfe1777e9bfafbb69e8d0a8ec21 (diff)
Fix scons failing when not building sources
-rw-r--r--SConstruct5
1 files changed, 3 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 4085f713b7..45765976cd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -461,7 +461,8 @@ screen = sys.stdout
node_count = 0
node_count_max = 0
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):
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:
f.write('%d\n' % node_count)
-if (env["progress"] == "yes"):
+if ('env' in locals() and env["progress"] == "yes"):
try:
with open(node_count_fname) as f:
node_count_max = int(f.readline())