File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,21 @@ def _constructor_envfile_variables(loader, node):
4343 return new_value
4444
4545
46+ def _constructor_tuple_variables (loader , node ):
47+ """
48+ Extracts the tuple variable from the node's value.
49+ :param yaml.Loader loader: the yaml loader
50+ :param node: the current node in the yaml
51+ :return: value of the tuple
52+ """
53+ return tuple (loader .construct_sequence (node ))
54+
55+
4656TAG_ENV = "!ENV"
4757TAG_ENVFILE = "!ENVFILE"
58+ TAG_TUPLE = "tag:yaml.org,2002:python/tuple"
4859
4960
5061_safe_loader .add_constructor (TAG_ENV , _constructor_env_variables )
5162_safe_loader .add_constructor (TAG_ENVFILE , _constructor_envfile_variables )
63+ _safe_loader .add_constructor (TAG_TUPLE , _constructor_tuple_variables )
You can’t perform that action at this time.
0 commit comments