Skip to content

Commit

Permalink
[api] json loading with script to allow loading of utf-8 scripts with…
Browse files Browse the repository at this point in the history
… control characters
  • Loading branch information
xeroc committed Jul 22, 2016
1 parent 246a27e commit 8eab237
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions grapheneapi/graphenewsrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ def wsconnect(self):
self.ws = create_connection(self.url)
break
except KeyboardInterrupt:
print("Cought key interrupt!")
sys.exit(1)
except Exception as e:
print(e)
raise
except:
if (self.num_retries >= 0 and cnt > self.num_retries):
raise NumRetriesReached()

Expand Down Expand Up @@ -312,10 +310,7 @@ def rpcexec(self, payload):
reply = self.ws.recv()
break
except KeyboardInterrupt:
print("Cought key interrupt!")
sys.exit(1)
# except WebSocketConnectionClosedException:
# sys.exit(1)
raise
except:
if (self.num_retries > -1 and
cnt > self.num_retries):
Expand All @@ -336,7 +331,7 @@ def rpcexec(self, payload):

ret = {}
try:
ret = json.loads(reply)
ret = json.loads(reply, strict=False)
except ValueError:
raise ValueError("Client returned invalid format. Expected JSON!")

Expand Down

0 comments on commit 8eab237

Please sign in to comment.