Skip to content

Commit 339c99d

Browse files
committed
actionsmap: fix an edgecase bug when using yaml references to not repeat 'arguments' across multiple actions, but the 'arguments' dictionnary is getting modified by add_action_parser somehow
1 parent e96c0cc commit 339c99d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

moulinette/actionsmap.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
#
2020

21+
import copy
2122
import os
2223
import re
2324
import logging
@@ -646,7 +647,7 @@ def _construct_parser(self, actionsmap, top_parser):
646647
# Store action identifier and add arguments
647648
action_parser.set_defaults(_tid=tid)
648649
action_parser.add_arguments(
649-
arguments,
650+
copy.deepcopy(arguments),
650651
extraparser=self.extraparser,
651652
format_arg_names=top_parser.format_arg_names,
652653
validate_extra=validate_extra,
@@ -696,7 +697,7 @@ def _construct_parser(self, actionsmap, top_parser):
696697
# Store action identifier and add arguments
697698
action_parser.set_defaults(_tid=tid)
698699
action_parser.add_arguments(
699-
arguments,
700+
copy.deepcopy(arguments),
700701
extraparser=self.extraparser,
701702
format_arg_names=top_parser.format_arg_names,
702703
validate_extra=validate_extra,

0 commit comments

Comments
 (0)