From 20f5074063cf701f7f077ff46ce8f2cec41b9ac4 Mon Sep 17 00:00:00 2001 From: Marko Mecina <marko.mecina@univie.ac.at> Date: Thu, 1 Sep 2022 10:57:02 +0200 Subject: [PATCH] handle NoneType arguments properly --- Ccs/ccs_function_lib.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Ccs/ccs_function_lib.py b/Ccs/ccs_function_lib.py index 42b039b..f66ac01 100644 --- a/Ccs/ccs_function_lib.py +++ b/Ccs/ccs_function_lib.py @@ -165,7 +165,10 @@ def start_pv(pool_name=None, console=False, **kwargs): directory = cfg.get('paths', 'ccs') file_path = os.path.join(directory, 'poolview_sql.py') - start_app(file_path, directory, pool_name, console=console, **kwargs) + if pool_name is not None: + start_app(file_path, directory, pool_name, console=console, **kwargs) + else: + start_app(file_path, directory, console=console, **kwargs) # Start only PoolManager @@ -2839,7 +2842,7 @@ def get_tm_id(pcf_descr=None): def get_data_pool_items(pcf_descr=None, src_file=None): - if not isinstance(src_file, str): + if not isinstance(src_file, (str, type(None))): raise TypeError('src_file must be str, is {}.'.format(type(src_file))) if src_file: -- GitLab