Permalink
Browse files

json: Replace most use of simplejson with json.

This is progress towards removing simplejson as a dependency.
  • Loading branch information...
timabbott committed Oct 12, 2017
1 parent f8b103b commit 6176d0fbca0d20a658088c0d873eef0a96bf4ff1
Showing with 7 additions and 7 deletions.
  1. +2 −2 tools/send-github-payloads
  2. +1 −1 tools/update-authors-json
  3. +2 −2 zerver/views/users.py
  4. +2 −2 zerver/worker/queue_processors.py
@@ -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
@@ -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")
@@ -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'
View
@@ -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
@@ -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,
@@ -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
@@ -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)

0 comments on commit 6176d0f

Please sign in to comment.