2626import copy
2727import gzip
2828import httplib2
29+ import json
2930import logging
3031import mimeparse
3132import mimetypes
4950from errors import UnexpectedMethodError
5051from model import JsonModel
5152from oauth2client import util
52- from oauth2client .anyjson import simplejson
5353
5454
5555DEFAULT_CHUNK_SIZE = 512 * 1024
@@ -221,7 +221,7 @@ def _to_json(self, strip=None):
221221 del d [member ]
222222 d ['_class' ] = t .__name__
223223 d ['_module' ] = t .__module__
224- return simplejson .dumps (d )
224+ return json .dumps (d )
225225
226226 def to_json (self ):
227227 """Create a JSON representation of an instance of MediaUpload.
@@ -244,7 +244,7 @@ def new_from_json(cls, s):
244244 An instance of the subclass of MediaUpload that was serialized with
245245 to_json().
246246 """
247- data = simplejson .loads (s )
247+ data = json .loads (s )
248248 # Find and call the right classmethod from_json() to restore the object.
249249 module = data ['_module' ]
250250 m = __import__ (module , fromlist = module .split ('.' )[:- 1 ])
@@ -436,7 +436,7 @@ def to_json(self):
436436
437437 @staticmethod
438438 def from_json (s ):
439- d = simplejson .loads (s )
439+ d = json .loads (s )
440440 return MediaFileUpload (d ['_filename' ], mimetype = d ['_mimetype' ],
441441 chunksize = d ['_chunksize' ], resumable = d ['_resumable' ])
442442
@@ -913,12 +913,12 @@ def to_json(self):
913913 del d ['_sleep' ]
914914 del d ['_rand' ]
915915
916- return simplejson .dumps (d )
916+ return json .dumps (d )
917917
918918 @staticmethod
919919 def from_json (s , http , postproc ):
920920 """Returns an HttpRequest populated with info from a JSON object."""
921- d = simplejson .loads (s )
921+ d = json .loads (s )
922922 if d ['resumable' ] is not None :
923923 d ['resumable' ] = MediaUpload .new_from_json (d ['resumable' ])
924924 return HttpRequest (
@@ -1430,8 +1430,8 @@ def __call__(self, http, postproc, uri, method='GET', body=None,
14301430 # or expecting a body and not provided one.
14311431 raise UnexpectedBodyError (expected_body , body )
14321432 if isinstance (expected_body , str ):
1433- expected_body = simplejson .loads (expected_body )
1434- body = simplejson .loads (body )
1433+ expected_body = json .loads (expected_body )
1434+ body = json .loads (body )
14351435 if body != expected_body :
14361436 raise UnexpectedBodyError (expected_body , body )
14371437 return HttpRequestMock (resp , content , postproc )
@@ -1522,7 +1522,7 @@ def request(self, uri,
15221522 if content == 'echo_request_headers' :
15231523 content = headers
15241524 elif content == 'echo_request_headers_as_json' :
1525- content = simplejson .dumps (headers )
1525+ content = json .dumps (headers )
15261526 elif content == 'echo_request_body' :
15271527 if hasattr (body , 'read' ):
15281528 content = body .read ()
0 commit comments