summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-06-08 08:55:06 +0100
committerIan Romanick <ian.d.romanick@intel.com>2013-06-26 10:58:23 -0700
commit886cf1e732727e07d2ebd4e3f57ce6be5b96554d (patch)
treeb79e854917f74e0e063527a01f6d19e3569d8380
parent6c210d949b5a93c6c58738c1be97158a3a098308 (diff)
scons: Fix implicit python dependency discovery on Windows.
Probably due to CRLF endings, the discovery of python import statements was not working on Windows builds, causing incremental builds to often fail unless one wiped out the build directory. NOTE: This is a candidate for stable branches. (cherry picked from commit 0aca2c6b608b80661cb8fd35eb08195ab95743f5)
-rw-r--r--scons/custom.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scons/custom.py b/scons/custom.py
index 658df97829b..39a5333fd01 100644
--- a/scons/custom.py
+++ b/scons/custom.py
@@ -95,7 +95,7 @@ def createConvenienceLibBuilder(env):
# TODO: handle import statements with multiple modules
# TODO: handle from import statements
-import_re = re.compile(r'^import\s+(\S+)$', re.M)
+import_re = re.compile(r'^\s*import\s+(\S+)\s*$', re.M)
def python_scan(node, env, path):
# http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
@@ -113,6 +113,7 @@ def python_scan(node, env, path):
if os.path.exists(file):
results.append(env.File(file))
break
+ #print node, map(str, results)
return results
python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])