From 53c3bacee5ac9ddd7b593f35bc6427c73bc0d7e1 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver <thomas@kluyver.me.uk> Date: Fri, 12 Nov 2021 13:20:42 +0000 Subject: [PATCH] Use attribute access for args object --- src/xfel_calibrate/nb_args.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xfel_calibrate/nb_args.py b/src/xfel_calibrate/nb_args.py index bc3ac261b..3dc5280b9 100644 --- a/src/xfel_calibrate/nb_args.py +++ b/src/xfel_calibrate/nb_args.py @@ -414,7 +414,8 @@ def parse_argv_and_load_nb(argv) -> Tuple[Dict, NBDetails]: not_reproducible_args = sorted( ('--' + x.replace('_', '-') for x in ['skip_env_freeze'] - if args[x])) + if getattr(args, x)) + ) # If any of these arguments are set, present a warning. if not_reproducible_args: -- GitLab