diff options
-rw-r--r-- | xnt/commands/target.py | 2 | ||||
-rw-r--r-- | xnt/tasks.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xnt/commands/target.py b/xnt/commands/target.py index ca6f7fe..0520c74 100644 --- a/xnt/commands/target.py +++ b/xnt/commands/target.py @@ -62,7 +62,7 @@ class TargetCommand(Command): except AttributeError: return None try: - if len(props) > 0: + if props and len(props) > 0: setattr(self.build, "properties", process_params(props, __get_properties())) diff --git a/xnt/tasks.py b/xnt/tasks.py index a647b0b..1fdc0da 100644 --- a/xnt/tasks.py +++ b/xnt/tasks.py @@ -129,8 +129,12 @@ def xntcall(path, targets=None, props=None): """ import xnt.xenant from xnt.commands.target import TargetCommand + cwd = os.getcwd() command = TargetCommand(xnt.xenant.load_build(path)) - return command.run(targets=targets, props=props) + os.chdir(path) + error_code = command.run(targets=targets, props=props) + os.chdir(cwd) + return error_code def call(command, stdout=None, stderr=None): """ Execute the given command, redirecting stdout and stderr |