Make use of callable string

Instead of explicitly using eval, make use of the
new callable string feature
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2015-07-09 23:42:52 +02:00
parent 33651430d0
commit df485e4bd4
2 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ class user_interface (object):
raise Exception('Invalid name for destination relation')
expr = parser.parse(query)
result = eval(expr, self.relations)
result = expr(self.relations)
self.relations[relname] = result
return result

View File

@ -287,7 +287,7 @@ def exec_query(command):
# Execute query
try:
pyquery = parser.parse(query)
result = eval(pyquery, relations)
result = pyquery(relations)
print (colorize("-> query: %s" % pyquery, 0x00ff00))