From 6e18fceed7fc1d6ce1026f787696d9df9e605232 Mon Sep 17 00:00:00 2001 From: Michiel Cottaar <MichielCottaar@gmail.com> Date: Wed, 10 Oct 2018 14:04:32 +0100 Subject: [PATCH] BUG: don't include unset variables in all_variables --- fsl/utils/filetree/filetree.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsl/utils/filetree/filetree.py b/fsl/utils/filetree/filetree.py index 151583e30..edcccc9fb 100644 --- a/fsl/utils/filetree/filetree.py +++ b/fsl/utils/filetree/filetree.py @@ -48,10 +48,11 @@ class FileTree(object): """ All tree variables including those from the parent tree """ + without_none = {key: value for key, value in self.variables.items() if value is not None} if self.parent is None: - return dict(self.variables) + return without_none res = self.parent.all_variables - res.update(self.variables) + res.update(without_none) return res def get_variable(self, name: str) -> str: -- GitLab