From 5709327cb451d29c529b0a6b4ce83288530c8769 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Wed, 13 Feb 2013 15:16:07 +0100 Subject: rnctree.py: Python 2.6 compatibility (no dict comprehension) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- rnctree.py | 6 +++--- 1 file 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) -- cgit