summaryrefslogtreecommitdiff
path: root/scalarstring.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-06-09 15:29:00 +0200
committerAnthon van der Neut <anthon@mnt.org>2021-06-09 15:29:00 +0200
commit5a5b603289bfd9b9e1bcd57618cf8694bd0ec2aa (patch)
tree3244f3c128fbb54bfc57e06f309a3ea333a62938 /scalarstring.py
parent148949be5260969391a5b993cbb3fb602bed55a6 (diff)
downloadruamel.yaml-5a5b603289bfd9b9e1bcd57618cf8694bd0ec2aa.tar.gz
fix for issue 3870.17.8
tagged objects that have a templated (idNNN) anchor, did get the anchor added explicitly, resulting potentially in double anchors
Diffstat (limited to 'scalarstring.py')
-rw-r--r--scalarstring.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scalarstring.py b/scalarstring.py
index f5fb6a2..7538ab7 100644
--- a/scalarstring.py
+++ b/scalarstring.py
@@ -23,8 +23,8 @@ class ScalarString(str):
def __new__(cls, *args, **kw):
# type: (Any, Any) -> Any
- anchor = kw.pop('anchor', None) # type: ignore
- ret_val = str.__new__(cls, *args, **kw) # type: ignore
+ anchor = kw.pop('anchor', None)
+ ret_val = str.__new__(cls, *args, **kw)
if anchor is not None:
ret_val.yaml_set_anchor(anchor, always_dump=True)
return ret_val
@@ -126,7 +126,7 @@ def walk_tree(base, map=None):
map[':'] = SingleQuotedScalarString
walk_tree(data, map=map)
"""
- from collections.abc import MutableMapping, MutableSequence # type: ignore
+ from collections.abc import MutableMapping, MutableSequence
if map is None:
map = {'\n': preserve_literal}
@@ -145,7 +145,7 @@ def walk_tree(base, map=None):
for idx, elem in enumerate(base):
if isinstance(elem, str):
for ch in map:
- if ch in elem: # type: ignore
+ if ch in elem:
base[idx] = map[ch](elem)
break
else: