diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-06-19 22:18:45 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-06-19 22:18:45 +0100 |
| commit | aacf4fe9a17a10c932a9b3635f36e5e73cfd32e4 (patch) | |
| tree | ef4e33b0df9ac24e0be605a1a22365ae46b7d047 | |
| parent | df5c16e23fdd70288b62026ba87fdb0af535ab6a (diff) | |
Check return value of jq_init
| -rw-r--r-- | jq.pyx | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -32,9 +32,10 @@ cdef extern from "jv_parse.h": def jq(char* program): - cdef jq_state *jq - # TODO: error if !jq - jq = jq_init() + cdef jq_state *jq = jq_init() + if not jq: + raise Exception("jq_init failed") + # TODO: jq_compile prints error to stderr cdef int compiled = jq_compile(jq, program) |
