mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
New DatabaseReader reads ledger numbers from database.
This commit is contained in:
committed by
Vinnie Falco
parent
6069400538
commit
f54280aaad
@@ -20,7 +20,10 @@ REMAPPINGS = {
|
||||
}
|
||||
|
||||
def eval_arguments(args):
|
||||
tokens = tokenize.generate_tokens(StringIO(args or '()').readline)
|
||||
args = args.strip()
|
||||
if not args or (args == '()'):
|
||||
return ()
|
||||
tokens = list(tokenize.generate_tokens(StringIO(args).readline))
|
||||
def remap():
|
||||
for type, name, _, _, _ in tokens:
|
||||
if type == tokenize.NAME and name not in REMAPPINGS:
|
||||
@@ -30,7 +33,11 @@ def eval_arguments(args):
|
||||
untok = tokenize.untokenize(remap())
|
||||
if untok[1:-1].strip():
|
||||
untok = untok[:-1] + ',)' # Force a tuple.
|
||||
return eval(untok, REMAPPINGS)
|
||||
try:
|
||||
return eval(untok, REMAPPINGS)
|
||||
except Exception as e:
|
||||
raise ValueError('Couldn\'t evaluate expression "%s" (became "%s"), '
|
||||
'error "%s"' % (args, untok, str(e)))
|
||||
|
||||
class Function(object):
|
||||
def __init__(self, desc='', default_path=''):
|
||||
|
||||
Reference in New Issue
Block a user