Error message when compilation fails

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

This shows an appropriate message.
master
Salvo 'LtWorf' Tomaselli 2016-03-31 21:37:43 +07:00
parent 7661d21da2
commit 85f2b3c3ee
1 changed files with 4 additions and 1 deletions

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