Getting the wrong exception type when expression uses all
Expect to get an CELEvalError but instead of a TypeError
import celpy
from celpy import CELEvalError
env = celpy.Environment()
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
all_positive = "data.all(x, x>0)"
breaks = {'data_': [1, 2, 3] }
ast = env.compile(all_positive)
prgm = env.program(ast)
try:
prgm.evaluate(breaks)
except CELEvalError as ex:
print('Got an evaluation error')
except TypeError as ex:
print('Got a type error')
Happy to try and fix with some guidance
Getting the wrong exception type when expression uses all
Expect to get an CELEvalError but instead of a TypeError
Happy to try and fix with some guidance