Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cjson in favor of the python json module. #50

Merged
merged 1 commit into from
Jun 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions qds_sdk/connection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sys
import requests
import cjson
import logging
import ssl
import json
Expand Down Expand Up @@ -64,7 +63,7 @@ def _api_call_raw(self, req_type, path, data=None):
kwargs = {'headers': self._headers, 'auth': self.auth, 'verify': not self.skip_ssl_cert_check}

if data:
kwargs['data'] = cjson.encode(data)
kwargs['data'] = json.dumps(data)

log.info("[%s] %s" % (req_type, url))
log.info("Payload: %s" % json.dumps(data, indent=4))
Expand Down
5 changes: 2 additions & 3 deletions qds_sdk/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
qds_sdk.Resource represents a REST based resource with standard methods like
create/find etc.
"""

import json
import util
import cjson
from qubole import Qubole


Expand Down Expand Up @@ -79,7 +78,7 @@ def __getattr__(self, name):
raise AttributeError(name)

def __str__(self):
return cjson.encode(self.attributes)
return json.dumps(self.attributes)


class Resource(BaseResource):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from setuptools import setup

INSTALL_REQUIRES = ['python_cjson', 'requests >=1.0.3', 'boto >=2.1.1']
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')

Expand Down