Skip to content

Commit

Permalink
json: Replace most use of simplejson with json.
Browse files Browse the repository at this point in the history
This is progress towards removing simplejson as a dependency.
  • Loading branch information
timabbott committed Oct 12, 2017
1 parent f8b103b commit 6176d0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tools/send-github-payloads
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import sys
import os
import simplejson
import json

sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'api'))
import zulip
Expand All @@ -11,7 +11,7 @@ zulip_client = zulip.Client(site="http://localhost:9991", client="ZulipGithubPay
payload_dir = "zerver/fixtures/github"
for filename in os.listdir(payload_dir):
with open(os.path.join(payload_dir, filename)) as f:
req = simplejson.loads(f.read())
req = json.loads(f.read())
req['api-key'] = zulip_client.api_key
req['email'] = zulip_client.email
zulip_client.do_api_query(req, zulip.API_VERSTRING + "external/github")
2 changes: 1 addition & 1 deletion tools/update-authors-json
Expand Up @@ -18,7 +18,7 @@ import subprocess

from six.moves import range
import requests
import simplejson as json
import json

sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
Expand Down
4 changes: 2 additions & 2 deletions zerver/views/users.py
@@ -1,7 +1,7 @@
from typing import Callable, Text, Union, Optional, Dict, Any, List, Tuple

import os
import simplejson as json
import ujson

from django.http import HttpRequest, HttpResponse

Expand Down Expand Up @@ -445,7 +445,7 @@ def about_view(request):
# type: (HttpRequest) -> HttpResponse

with open(settings.CONTRIBUTORS_DATA) as f:
data = json.load(f)
data = ujson.load(f)

return render(
request,
Expand Down
4 changes: 2 additions & 2 deletions zerver/worker/queue_processors.py
Expand Up @@ -54,7 +54,7 @@
import datetime
import logging
import requests
import simplejson
import ujson
from six.moves import cStringIO as StringIO
import re
import importlib
Expand Down Expand Up @@ -316,7 +316,7 @@ def start(self):
'forward_error',
method='POST',
url='deployments/report_error',
make_request=(lambda type, report: {'type': type, 'report': simplejson.dumps(report)}),
make_request=(lambda type, report: {'type': type, 'report': ujson.dumps(report)}),
)
QueueProcessingWorker.start(self)

Expand Down

0 comments on commit 6176d0f

Please sign in to comment.