From 5d8e0bb049a5ffdc0197a1e8436f358d4352ce09 Mon Sep 17 00:00:00 2001 From: Sergey Golitsynskiy Date: Fri, 21 Dec 2018 12:42:25 -0500 Subject: [PATCH] Correct code error in 'build job runner' tutorial When __init__ is called, **kwargs (most likely) will not contain the 'runner_param_specs' key. And if so, calling update() on kwargs['runner_param_specs'] will cause an error. Check if key exists, then update or create. --- doc/source/dev/build_a_job_runner.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/dev/build_a_job_runner.rst b/doc/source/dev/build_a_job_runner.rst index a34c7a0f638..7ff556e32f7 100644 --- a/doc/source/dev/build_a_job_runner.rst +++ b/doc/source/dev/build_a_job_runner.rst @@ -120,7 +120,10 @@ B: Update the dictionary structure in kwargs. :: - kwargs['runner_param_specs'].update(runner_param_specs) + if 'runner_param_specs' in kwargs: + kwargs['runner_param_specs'].update(runner_param_specs) + else: + kwargs['runner_param_specs'] = runner_param_specs C: Now call the parent constructor to assign the values.