next = statement[percent + 1]
if next == '(':
start = statement.index(')', percent + 2) + 2
+ assert statement[start - 1] == 's'
elif next == '{':
start = statement.index('}', percent + 2)
+ assert statement[start + 1] == 's'
code = statement[percent + 2:start]
if f_globals == None:
# XXX: compile() in the frame's context
context[key] = eval(code, f_globals, f_locals)
- statement = '%s%%(%s)s%s' % (statement[0:percent], key, statement[start + 1:])
+ statement = '%s%%(%s)%s' % (statement[0:percent], key, statement[start + 1:])
start = percent + len(key) + 4
elif next in ('%', 's'):
start = percent + 2