From dd8e369ce52b6958d101857a5d6c802554099488 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Wed, 5 Sep 2012 22:35:46 +1200 Subject: [PATCH] I hate this Python API --- plugins/util/execute.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/util/execute.py b/plugins/util/execute.py index b5205b4..9aecd7e 100644 --- a/plugins/util/execute.py +++ b/plugins/util/execute.py @@ -7,6 +7,10 @@ def eval_py(code, paste_multiline=True): while True: try: 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 except http.HTTPError: if attempts > 2: