File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -461,15 +461,20 @@ def _render_context(self) -> AnyByStrMutableMapping:
461461 "os" : lambda : OS ,
462462 }
463463 )
464- return dict (
464+ context = dict (
465465 ** self .answers .combined ,
466466 _copier_answers = self ._answers_to_remember (),
467467 _copier_conf = conf ,
468468 _folder_name = self .subproject .local_abspath .name ,
469469 _copier_python = sys .executable ,
470470 _copier_phase = Phase .current (),
471- _copier_operation = _operation .get (),
472471 )
472+ # ``_copier_operation`` is only defined within a copy/update/recopy run.
473+ # Outside of one (e.g. ``check_update`` or other bare-``Worker`` use),
474+ # leave it unset so rendering doesn't require an active operation.
475+ if (operation := _operation .get (None )) is not None :
476+ context ["_copier_operation" ] = operation
477+ return context
473478
474479 def _path_matcher (self , patterns : Iterable [str ]) -> Callable [[Path ], bool ]:
475480 """Produce a function that matches against specified patterns."""
You can’t perform that action at this time.
0 commit comments