Skip to content

Commit

Permalink
No need for simplejson
Browse files Browse the repository at this point in the history
  • Loading branch information
jay0lee committed Jan 14, 2016
1 parent 1960b20 commit 0fde64e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
from itertools import islice, chain
import base64
import json

try:
import json as simplejson
except ImportError:
import simplejson

import httplib2
import oauth2client.client
import oauth2client.file
Expand Down Expand Up @@ -475,7 +469,7 @@ def callGAPI(service, function, soft_errors=False, throw_reasons=[], **kwargs):
try:
return method.execute()
except googleapiclient.errors.HttpError as e:
error = simplejson.loads(e.content.decode('utf-8'))
error = json.loads(e.content.decode('utf-8'))
try:
reason = error['error']['errors'][0]['reason']
http_status = error['error']['code']
Expand Down Expand Up @@ -798,7 +792,7 @@ def refresh_message(request_id, response, exception):
def restored_message(request_id, response, exception):
if exception is not None:
try:
error = simplejson.loads(exception.content.decode('utf-8'))
error = json.loads(exception.content.decode('utf-8'))
if error['error']['code'] == 400:
print("\nERROR: %s: %s. Skipping message restore, you can retry later with --fast-restore"
% (error['error']['code'], error['error']['errors'][0]['message']))
Expand Down

0 comments on commit 0fde64e

Please sign in to comment.