From bbe0a0cbfae52205601b3d1d858b26d2bfb9e32d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 13 Jul 2016 15:27:11 +0800 Subject: calc_coolfunc.py: add check the existence of t_profile --- calc_coolfunc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/calc_coolfunc.py b/calc_coolfunc.py index 32a7ada..c21e6b7 100755 --- a/calc_coolfunc.py +++ b/calc_coolfunc.py @@ -4,9 +4,11 @@ # # Aaron LI # Created: 2016-06-19 -# Updated: 2016-07-11 +# Updated: 2016-07-13 # # Change logs: +# 2016-07-13: +# * Add check of the existence of t_profile # 2016-07-11: # * Use a default config to allow a minimal user config # 2016-07-04: @@ -187,6 +189,9 @@ def main(): config_user = ConfigObj(args.config) config.merge(config_user) + if not os.path.exists(config["t_profile"]): + raise FileNotFoundError("file not exists: %s" % config["t_profile"]) + redshift = config.as_float("redshift") config_data = { "prog_name": os.path.basename(sys.argv[0]), -- cgit v1.2.2