summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jq.pyx7
1 files changed, 4 insertions, 3 deletions
diff --git a/jq.pyx b/jq.pyx
index 2c17d1b..f5de457 100644
--- a/jq.pyx
+++ b/jq.pyx
@@ -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)