Skip to content

Commit

Permalink
Merge pull request #494 from okin/feature/drop_simplejson
Browse files Browse the repository at this point in the history
Reducing simplejson use
  • Loading branch information
leplatrem committed Oct 4, 2018
2 parents ded8422 + 217c8b2 commit e4e1842
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ matrix:
- python: 3.6
env:
- TOX_ENV=py36
- python: "3.7-dev"
env:
- TOX_ENV=py37

notifications:
irc:
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CHANGELOG
3.5.0 (unreleased)
==================

- Nothing changed yet.
- cornice.errors and validation tests now use the builtin `json` module instead of `simplejson` (@okin)


3.4.0 (2018-04-12)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Cornice:
* Matt Skinner <skinner.m.c@gmail.com>
* Myroslav Opyr <myroslav@quintagroup.com>
* Nicolas Dietrich <nicodietrich@gmail.com>
* Niko Wenselowski <niko@nerdno.de>
* Olivier Roussy <olivier@gandi.net>
* Paul Smith <paulsmith@pobox.com>
* Ralph Bean <rbean@redhat.com>
Expand Down
4 changes: 2 additions & 2 deletions cornice/errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import simplejson as json
import json


class Errors(list):
Expand All @@ -26,7 +26,7 @@ def add(self, location, name=None, description=None, **kw):
@classmethod
def from_json(cls, string):
"""Transforms a json string into an `Errors` instance"""
obj = json.loads(string)
obj = json.loads(string.decode())
return Errors.from_list(obj.get('errors', []))

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import mock
import unittest
import warnings

from pyramid import compat
from pyramid.request import Request
import simplejson as json
from webtest import TestApp
try:
import colander
Expand Down

0 comments on commit e4e1842

Please sign in to comment.