Make use of callable string
Instead of explicitly using eval, make use of the new callable string feature
This commit is contained in:
parent
33651430d0
commit
df485e4bd4
@ -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
|
||||
|
||||
|
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user