Commit 1ed2d45a by Celine Mercier

obi grep: made an error message clearer (error could be eventually be

handled by program, looking for str in bytes returned by a column)
parent e43e49d6
......@@ -207,9 +207,12 @@ def Filter_generator(options, tax_filter):
)
if good and predicates:
good = (reduce(lambda bint x, bint y: x and y,
(bool(eval(p, loc_env, line))
for p in predicates), True))
try:
good = (reduce(lambda bint x, bint y: x and y,
(bool(eval(p, loc_env, line))
for p in predicates), True))
except TypeError:
raise Exception("Try replacing strings in python expression with bytes (by putting 'b' in front of strings, e.g. b'example')")
if good and lmin:
good = len(line) >= lmin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment