summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2018-08-24 12:56:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-08-24 12:56:37 (GMT)
commit0e03e260c7ae4cc598f1185be59e02c42fc72eca (patch) (side-by-side diff)
tree6583923e6e12bf8c5d890659054f0afab0bd45d9
parentbdc4edc069a0a394db5bfc505982ce9e08526b46 (diff)
downloadwikitrans-0e03e260c7ae4cc598f1185be59e02c42fc72eca.tar.gz
wikitrans-0e03e260c7ae4cc598f1185be59e02c42fc72eca.tar.bz2
Minor fix
* wikitrans/wikitoken.py (WikiSeqNode) (WikiContentNode): Fix the use of map in 3.x
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--wikitrans/wikitoken.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wikitrans/wikitoken.py b/wikitrans/wikitoken.py
index 0678a75..deedea8 100644
--- a/wikitrans/wikitoken.py
+++ b/wikitrans/wikitoken.py
@@ -122,7 +122,8 @@ class WikiContentNode(WikiNode):
if self.type == 'TEXT':
ret['content'] = self.content
elif isinstance(self.content, list):
- ret['content'] = map(lambda x: x.json_encode(), self.content)
+ ret['content'] = [x for x in
+ map(lambda x: x.json_encode(), self.content)]
elif isinstance(self.content, WikiNode):
ret['content'] = self.content.json_encode()
else:
@@ -150,7 +151,7 @@ class WikiSeqNode(WikiContentNode):
if not self.content:
ret['content'] = None
elif isinstance(self.content, list):
- ret['content'] = map(lambda x: x.json_encode(), self.content)
+ ret['content'] = [x for x in map(lambda x: x.json_encode(), self.content)]
elif isinstance(self.content, WikiNode):
ret['content'] = self.content.json_encode()
else:

Return to:

Send suggestions and report system problems to the System administrator.