Use compile+eval to support statements and expressions
This commit is contained in:
parent
4700402db4
commit
c66b376e7f
1 changed files with 2 additions and 1 deletions
|
@ -3,7 +3,8 @@ from src import ModuleManager, utils
|
|||
|
||||
EVAL_TEMPLATE = """
|
||||
import sys
|
||||
result = eval(sys.stdin.read())
|
||||
compiled = compile(sys.stdin.read(), 'code', 'single')
|
||||
result = eval(compiled)
|
||||
print("")
|
||||
if not result == None:
|
||||
sys.stdout.write(str(result))
|
||||
|
|
Loading…
Reference in a new issue