Skip to content

Commit

Permalink
Fix Python 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
erwan committed Oct 28, 2014
1 parent 920d618 commit aa743e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions prismic/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ def ref_from_cookie(self, cookie):

@staticmethod
def parse(json):

return Experiments(
map(lambda e: Experiment.parse(e), (json and json.get("draft")) or []),
map(lambda e: Experiment.parse(e), (json and json.get("running")) or [])
[Experiment.parse(e) for e in ((json and json.get("draft") or []))],
[Experiment.parse(e) for e in ((json and json.get("running") or []))]
)


Expand All @@ -43,7 +44,7 @@ def parse(json):
json.get("id"),
json.get("googleId"),
json.get("name"),
map(lambda v: Variation.parse(v), json.get("variations"))
[Variation.parse(v) for v in json.get("variations")]
)


Expand Down

0 comments on commit aa743e2

Please sign in to comment.