I hate this Python API
This commit is contained in:
parent
61752baa24
commit
dd8e369ce5
1 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,10 @@ def eval_py(code, paste_multiline=True):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
output = http.get("http://eval.appspot.com/eval", statement=code).rstrip('\n')
|
output = http.get("http://eval.appspot.com/eval", statement=code).rstrip('\n')
|
||||||
|
# sometimes the API returns a blank string on first attempt, lets try again
|
||||||
|
# and make sure it is actually supposed to be a blank string. ._.
|
||||||
|
if output == "":
|
||||||
|
output = http.get("http://eval.appspot.com/eval", statement=code).rstrip('\n')
|
||||||
break
|
break
|
||||||
except http.HTTPError:
|
except http.HTTPError:
|
||||||
if attempts > 2:
|
if attempts > 2:
|
||||||
|
|
Reference in a new issue