summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2009-02-23 19:17:29 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2009-02-23 19:17:29 +0000
commit00b7723b8571b55a70d57d0cb9edd724c943ac3b (patch)
treee2b289090aa07319a3da6f3c82bcfeb53c04558a
parent9f0f135caa6ac2ffbbe4068de5e14023a5f023db (diff)
downloadpyyaml-00b7723b8571b55a70d57d0cb9edd724c943ac3b.tar.gz
Added a workaround against #116 (Thanks Andrey Somov).
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@345 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r--lib/yaml/emitter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/yaml/emitter.py b/lib/yaml/emitter.py
index 0932942..e6780ba 100644
--- a/lib/yaml/emitter.py
+++ b/lib/yaml/emitter.py
@@ -581,7 +581,9 @@ class Emitter(object):
return tag
handle = None
suffix = tag
- for prefix in self.tag_prefixes:
+ prefixes = self.tag_prefixes.keys()
+ prefixes.sort()
+ for prefix in prefixes:
if tag.startswith(prefix) \
and (prefix == u'!' or len(prefix) < len(tag)):
handle = self.tag_prefixes[prefix]