diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-09-29 21:25:59 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-09-29 21:25:59 +0100 |
| commit | 91844edc713e39ca2cbc1f2d7122e06bca1e653f (patch) | |
| tree | d9d7440ddf81687793a0982ec56bd808a71f1ea9 | |
| parent | 0db42091514c60d9d6a09d77fb085c09376e1327 (diff) | |
Support Python 3.3
| -rw-r--r-- | jq.pyx | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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): |
