summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-02-13 15:16:07 +0100
committerJan Pokorný <jpokorny@redhat.com>2013-02-13 15:18:03 +0100
commit5709327cb451d29c529b0a6b4ce83288530c8769 (patch)
treeb9d236bf892418194357c84555337a07bdbf084a
parent9707260d8a8f25665b1658d373340c87e52d5e4f (diff)
downloadrnc2rng-5709327cb451d29c529b0a6b4ce83288530c8769.tar.gz
rnc2rng-5709327cb451d29c529b0a6b4ce83288530c8769.tar.xz
rnc2rng-5709327cb451d29c529b0a6b4ce83288530c8769.zip
rnctree.py: Python 2.6 compatibility (no dict comprehension)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xrnctree.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rnctree.py b/rnctree.py
index f691a4f..90d935a 100755
--- a/rnctree.py
+++ b/rnctree.py
@@ -59,7 +59,7 @@ for t in tokens + quant_tokens_aux + parse_constructs:
keyword_list = keywords.values()
-PAIRS = {r[0]: tuple(r[1:]) for r in pair_rules}
+PAIRS = dict((r[0], tuple(r[1:])) for r in pair_rules)
TAGS = {
ONE: 'group',
@@ -458,8 +458,8 @@ def _nest_annotations(nodes, mapping, delim=None):
if not isinstance(n.value, str): # no recurse to terminal str
if n.type in (ELEM, ATTR):
- mapping_rec = {n: [] for n in
- (ANNOTATION, NS_ANNOTATION, COMMENT)}
+ mapping_rec = dict((n, []) for n in
+ (ANNOTATION, NS_ANNOTATION, COMMENT))
else:
mapping_rec = mapping
_nest_annotations(n.value, mapping_rec)