- Try to find the ICL license file path name in the external environment
and the registry before resorting to the hard-coded path name.
- - Add support for fetching command-line keyword=value arguments in
- order from an ARGLIST list.
-
From Simon Perkins:
- Fix a bug introduced in building shared libraries under MinGW.
s = s + ' Stop.'
sys.stderr.write("scons: *** %s\n" % s)
- if tb:
- sys.stderr.write("scons: internal stack trace:\n")
- traceback.print_tb(tb, file=sys.stderr)
+ if tb:
+ sys.stderr.write("scons: internal stack trace:\n")
+ traceback.print_tb(tb, file=sys.stderr)
self.do_failed(status)
s = eval(key, self.gvars, lvars)
except (IndexError, NameError, TypeError):
return ''
- except (SyntaxError):
- raise SCons.Errors.UserError, "Syntax error trying to evaluate `%s'" % s
+ except SyntaxError,e:
+ if self.target:
+ raise SCons.Errors.BuildError, (self.target[0], "Syntax error `%s' trying to evaluate `%s'" % (e,s))
+ else:
+ raise SCons.Errors.UserError, "Syntax error `%s' trying to evaluate `%s'" % (e,s)
else:
# Before re-expanding the result, handle
# recursive expansion by copying the local
s = eval(key, self.gvars, lvars)
except (IndexError, NameError, TypeError):
return
- except (SyntaxError):
- raise SCons.Errors.UserError, "Syntax error trying to evaluate `%s'" % s
+ except SyntaxError,e:
+ if self.target:
+ raise SCons.Errors.BuildError, (self.target[0], "Syntax error `%s' trying to evaluate `%s'" % (e,s))
+ else:
+ raise SCons.Errors.UserError, "Syntax error `%s' trying to evaluate `%s'" % (e,s)
else:
# Before re-expanding the result, handle
# recursive expansion by copying the local
try:
scons_subst('$foo.bar.3.0', env)
except SCons.Errors.UserError, e:
- assert str(e) == "Syntax error trying to evaluate `$foo.bar.3.0'", e
+ expect1 = "Syntax error `invalid syntax' trying to evaluate `$foo.bar.3.0'"
+ expect2 = "Syntax error `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'"
+ assert str(e) in [expect1, expect2], e
else:
raise AssertionError, "did not catch expected UserError"
try:
scons_subst_list('$foo.bar.3.0', env)
except SCons.Errors.UserError, e:
- assert str(e) == "Syntax error trying to evaluate `$foo.bar.3.0'", e
+ expect1 = "Syntax error `invalid syntax' trying to evaluate `$foo.bar.3.0'"
+ expect2 = "Syntax error `invalid syntax (line 1)' trying to evaluate `$foo.bar.3.0'"
+ assert str(e) in [expect1, expect2], e
else:
raise AssertionError, "did not catch expected SyntaxError"
""")
test.run(status=2, stderr="""
-scons: \*\*\* Syntax error trying to evaluate `\$foo\.bar\.3\.0'
+scons: \*\*\* Syntax error `invalid syntax( \(line 1\))?' trying to evaluate `\$foo\.bar\.3\.0'
File "SConstruct", line 2, in \?
""")
""")
test.run(status=2, stderr="""
-scons: \*\*\* Syntax error trying to evaluate `\$foo\.3\.0\.x'
+scons: \*\*\* Syntax error `invalid syntax( \(line 1\))?' trying to evaluate `\$foo\.3\.0\.x'
File "SConstruct", line 2, in \?
""")
+#Test syntax errors when trying to expand construction variables at build time:
+test.write('SConstruct', """\
+env = Environment()
+env.Command('foo.bar', [], '$foo.bar.3.0')
+""")
+
+test.run(status=2, stderr=r"""scons: \*\*\* \[foo\.bar\] Syntax error `invalid syntax( \(line 1\))?' trying to evaluate `\$foo\.bar\.3\.0'
+""")
+
+
+
test.pass_test()