Error message when compilation fails

Within selection, the compilation of the string into python bytecode
can fail.

This shows an appropriate message.
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2016-03-31 21:37:43 +02:00
parent 7661d21da2
commit 85f2b3c3ee

View File

@ -130,7 +130,10 @@ class Relation (object):
newt = relation()
newt.header = Header(self.header)
c_expr = compile(expr, 'selection', 'eval')
try:
c_expr = compile(expr, 'selection', 'eval')
except:
raise Exception('Failed to compile expression: %s' % expr)
for i in self.content:
# Fills the attributes dictionary with the values of the tuple