From e5c91eddf381c8adbe9ab4ce33c4fefff8f1a41c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 11 Jul 2016 23:02:20 +0800 Subject: calc_mass_potential.py: fix the bug about user config file --- calc_mass_potential.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calc_mass_potential.py b/calc_mass_potential.py index 8cfe24e..bb49501 100755 --- a/calc_mass_potential.py +++ b/calc_mass_potential.py @@ -608,8 +608,8 @@ def main(): args = parser.parse_args() config = ConfigObj(config_default.splitlines()) - if args.config != "": - config_user = ConfigObj(args.config) + if args.config is not None: + config_user = ConfigObj(open(args.config)) config.merge(config_user) ne_profile = np.loadtxt(config["ne_profile"]) -- cgit v1.2.2