From 80321666a4f265fae3c04c2eb360e32c9d333e7d Mon Sep 17 00:00:00 2001 From: Tore Niermann Date: Thu, 24 May 2018 15:29:34 +0200 Subject: [PATCH] Enabling DeprecationWarning by default Fixed bug due to deprecated "output" parameter --- holoaverage/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/holoaverage/main.py b/holoaverage/main.py index 3c70997..3a7bb49 100644 --- a/holoaverage/main.py +++ b/holoaverage/main.py @@ -245,7 +245,7 @@ def holoaverage(param, basepath="", verbose=0): output_aligned = bool(param.get('output_aligned', False)) if ('output_name' not in param) and ('output' in param): warnings.warn("The parameter 'output' is deprecated. Use 'output_name' instead.", DeprecationWarning) - output_name = os.path.join(path, str(param['output_name'])) + output_name = os.path.join(path, str(param['output'])) elif 'output_name' in param: output_name = os.path.join(path, str(param['output_name'])) else: @@ -423,9 +423,14 @@ def main(argv=None): :param argv: Arguments :returns: Exit code """ + # Get arguments if argv is None: argv = sys.argv + # Enable Deprecation warning by default + if not sys.warnoptions: + warnings.simplefilter("default", category=DeprecationWarning) + arg_index = 1 param_file = None verbose = 0