Various tweaks

This commit is contained in:
Luke Rogers 2012-09-05 21:35:44 +12:00
parent 6bb9819501
commit 61752baa24
3 changed files with 14 additions and 2 deletions

View file

@ -7,13 +7,13 @@ def eval_py(code, paste_multiline=True):
while True:
try:
output = http.get("http://eval.appspot.com/eval", statement=code).rstrip('\n')
break
except http.HTTPError:
if attempts > 2:
return "Failed to execute code."
else:
attempts += 1
continue
break
if "Traceback (most recent call last):" in output:
status = "Python error: "