From fafa42003bc21a314b39946ccaef42127dfa3228 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Thu, 16 Jul 2015 08:52:28 +0100 Subject: [PATCH] Bugfix - Memory logging was crashing if noisy list was empty. --- fsl/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fsl/__init__.py b/fsl/__init__.py index 1beef9641..5f7f01d38 100644 --- a/fsl/__init__.py +++ b/fsl/__init__.py @@ -223,6 +223,9 @@ def parseArgs(argv, allTools): namespace = parser.parse_args(fslArgv) + if namespace.noisy is None: + namespace.noisy = [] + # if the specified tool is 'help', it should be followed by # one more argument, the name of the tool to print help for if namespace.tool == 'help': @@ -288,9 +291,8 @@ def parseArgs(argv, allTools): logging.getLogger('props') .setLevel(logging.DEBUG) logging.getLogger('pwidgets').setLevel(logging.DEBUG) - if namespace.noisy is not None: - for mod in namespace.noisy: - logging.getLogger(mod).setLevel(logging.DEBUG) + for mod in namespace.noisy: + logging.getLogger(mod).setLevel(logging.DEBUG) # The trace module monkey-patches some # things if its logging level has been -- GitLab