From 0357db515646732e7ec301e9551f77b8c5afc03f Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Thu, 15 Oct 2015 20:07:05 +0200 Subject: [PATCH] Fail faster on invalid install_files inputs - Issue 1639 --- waflib/Build.py | 6 ++++-- waflib/Utils.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/waflib/Build.py b/waflib/Build.py index 7d0c56bf..6f7613bf 100644 --- a/waflib/Build.py +++ b/waflib/Build.py @@ -1043,6 +1043,7 @@ class InstallContext(BuildContext): :param postpone: execute the task immediately to perform the installation :type postpone: bool """ + assert(dest) tsk = inst(env=env or self.env) tsk.bld = self tsk.path = cwd or self.path @@ -1079,6 +1080,7 @@ class InstallContext(BuildContext): :param postpone: execute the task immediately to perform the installation :type postpone: bool """ + assert(dest) tsk = inst(env=env or self.env) tsk.bld = self tsk.path = cwd or self.path @@ -1111,11 +1113,11 @@ class InstallContext(BuildContext): :param relative_trick: make the symlink relative (default: ``False``) :type relative_trick: bool """ - if Utils.is_win32: # symlinks *cannot* work on that platform + # TODO waf 1.9 - replace by install_as return - + assert(dest) tsk = inst(env=env or self.env) tsk.bld = self tsk.dest = dest diff --git a/waflib/Utils.py b/waflib/Utils.py index 9ebaa2f8..26299d42 100644 --- a/waflib/Utils.py +++ b/waflib/Utils.py @@ -565,6 +565,8 @@ def subst_vars(expr, params): return params.get_flat(m.group(3)) except AttributeError: return params[m.group(3)] + # if you get a TypeError, it means that 'expr' is not a string... + # Utils.subst_vars(None, env) will not work return reg_subst.sub(repl_var, expr) def destos_to_binfmt(key):