summaryrefslogtreecommitdiff
path: root/representer.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-07-28 07:22:31 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-07-28 07:22:31 +0200
commit85e515c1943daea9ee7220b00882b13d7afc98cb (patch)
treee125a3e57229dd19fbf152abff0ebad356dbc58c /representer.py
parent2565253f6b61d567280027719181c39250f8a0bb (diff)
downloadruamel.yaml-85e515c1943daea9ee7220b00882b13d7afc98cb.tar.gz
fix for issue #143: handling single excl mark tags0.15.22
There were no tests for roundtripping tags for non-registered objects
Diffstat (limited to 'representer.py')
-rw-r--r--representer.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/representer.py b/representer.py
index 3b0ff63..6d1e8c1 100644
--- a/representer.py
+++ b/representer.py
@@ -988,9 +988,10 @@ class RoundTripRepresenter(SafeRepresenter):
except AttributeError:
t = None
if t:
- while t and t[0] == '!':
- t = t[1:]
- tag = 'tag:yaml.org,2002:' + t
+ if t.startswith('!!'):
+ tag = 'tag:yaml.org,2002:' + t[2:]
+ else:
+ tag = t
else:
tag = u'tag:yaml.org,2002:map'
return self.represent_mapping(tag, data)