Closed dovinmu closed 1 year ago
def inner_exec(obj, *args, **kwargs): print('this', obj) exec(obj, globals(), locals()) # Execute the provided Python code
code = ''' print('hi') ''' inner_exec(code)
Same with !literal
. My current hypothesis is that the prompt argument stopped being passed into it since 4d531b7373c2e007548486b717b57a9741b6bd9e.
The bug is that when the arity is 0 (e.g. !python
!literal
) then we go directly into call_cmd
, and do not pass in the operands
.
The prompt is then lost, because the prompt is now carried in operands
. It otherwise seems to be set correctly.
Execution of ops with arity 0: https://github.com/saulpw/aipl/blob/develop/aipl/interpreter.py#L209
Where the prompot gets set: https://github.com/saulpw/aipl/blob/develop/aipl/interpreter.py#L146
!python
no longer seems to be working on latest develop:adding a debug line in
python.py
:Just prints "this"