From 91844edc713e39ca2cbc1f2d7122e06bca1e653f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 29 Sep 2013 21:25:59 +0100 Subject: Support Python 3.3 --- jq.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jq.pyx b/jq.pyx index 6c568eb..ff95146 100644 --- a/jq.pyx +++ b/jq.pyx @@ -57,13 +57,13 @@ cdef class _Program(object): string_input = input if raw_input else json.dumps(input) bytes_input = string_input.encode("utf8") result_bytes = self._string_to_strings(bytes_input) - result_strings = result_bytes + result_strings = map(lambda s: s.decode("utf8"), result_bytes) if raw_output: return "\n".join(result_strings) elif multiple_output: - return map(json.loads, result_strings) + return [json.loads(s) for s in result_strings] else: - return json.loads(result_strings[0]) + return json.loads(next(iter(result_strings))) cdef object _string_to_strings(self, char* input): -- cgit v1.2.3