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:
parent
7661d21da2
commit
85f2b3c3ee
@ -130,7 +130,10 @@ class Relation (object):
|
|||||||
newt = relation()
|
newt = relation()
|
||||||
newt.header = Header(self.header)
|
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:
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user