Skip to content

Commit

Permalink
fix json loads
Browse files Browse the repository at this point in the history
  • Loading branch information
restran committed Mar 16, 2020
1 parent 58dc698 commit 6e5b2d5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -4,7 +4,9 @@ python:
- pypy
- 3.4
- 3.5

- 3.6
- 3.7
- 3.8
_base_envs:
- &pypy_base
python: pypy
Expand Down Expand Up @@ -50,8 +52,6 @@ _base_envs:
matrix:
fast_finish: true
include:
- python: 3.6
env: TOXENV=pre-commit
- <<: *pypy_base
python: pypy3
env:
Expand Down
5 changes: 1 addition & 4 deletions mountains/json/__init__.py
Expand Up @@ -46,10 +46,7 @@ def json_default(obj):


def loads(content, encoding='utf-8', **kwargs):
if PY3:
return json.loads(s=force_bytes(content), encoding=encoding, **kwargs)
else:
return json.loads(s=content, encoding=encoding, **kwargs)
return json.loads(s=content, encoding=encoding, **kwargs)


def dumps(dict_data, ensure_ascii=True, indent=None,
Expand Down
2 changes: 1 addition & 1 deletion mountains/utils/string_utils.py
Expand Up @@ -2,7 +2,7 @@
# Created by restran on 2017/11/7
from __future__ import unicode_literals, absolute_import
from ..encoding import force_bytes
from .. import PY2
from .. import PY2, string_types


def fixed_length_split(s, width):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Expand Up @@ -5,7 +5,7 @@
import logging
import unittest

from mountains.utils import *
from mountains.utils import any_in, any_none

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 6e5b2d5

Please sign in to comment.