summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2017-11-25 18:49:09 +0100
committerStefan Kögl <stefan@skoegl.net>2017-11-25 18:49:09 +0100
commit7b4fb660a5d6ff7d81c35ea1565b751a994aa854 (patch)
treed9d83775fdbdae9c9e145fecc649d5eb500db2bb
parent6b777b7c414f69f3b8f3c16ba1c871246b481d4f (diff)
parentb6514dd9551d453f2ee8485283d538e00f5015be (diff)
downloadpython-json-patch-7b4fb660a5d6ff7d81c35ea1565b751a994aa854.tar.gz
Merge branch 'master' into jsondiff
-rw-r--r--.travis.yml2
-rw-r--r--doc/index.rst6
-rw-r--r--jsonpatch.py22
-rw-r--r--setup.py6
4 files changed, 6 insertions, 30 deletions
diff --git a/.travis.yml b/.travis.yml
index f20aa6f..0239972 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- - "2.6"
- "2.7"
- "3.3"
- "3.4"
@@ -11,7 +10,6 @@ python:
install:
- travis_retry pip install -r requirements.txt
- - if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then travis_retry pip install 'coverage<4'; fi
- travis_retry pip install coveralls
script:
diff --git a/doc/index.rst b/doc/index.rst
index 674c9e5..cbae4ff 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -6,9 +6,9 @@
python-json-patch
=================
-*python-json-patch* is a Python library for applying JSON patches (`RFC
-6902 <http://tools.ietf.org/html/rfc6902>`_). Python 2.6, 2.7, 3.2, 3.3
-and PyPy are supported.
+*python-json-patch* is a Python library for applying JSON patches (`RFC 6902
+<http://tools.ietf.org/html/rfc6902>`_). Python 2.7 and 3.3-3.6 are
+supported. Tests are run on both CPython and PyPy.
**Contents**
diff --git a/jsonpatch.py b/jsonpatch.py
index b490108..c4cbb30 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -103,25 +103,9 @@ def multidict(ordered_pairs):
)
-def get_loadjson():
- """ adds the object_pairs_hook parameter to json.load when possible
-
- The "object_pairs_hook" parameter is used to handle duplicate keys when
- loading a JSON object. This parameter does not exist in Python 2.6. This
- methods returns an unmodified json.load for Python 2.6 and a partial
- function with object_pairs_hook set to multidict for Python versions that
- support the parameter. """
-
- if sys.version_info >= (3, 3):
- args = inspect.signature(json.load).parameters
- else:
- args = inspect.getargspec(json.load).args
- if 'object_pairs_hook' not in args:
- return json.load
-
- return functools.partial(json.load, object_pairs_hook=multidict)
-
-json.load = get_loadjson()
+# The "object_pairs_hook" parameter is used to handle duplicate keys when
+# loading a JSON object.
+json.load = functools.partial(json.load, object_pairs_hook=multidict)
def apply_patch(doc, patch, in_place=False):
diff --git a/setup.py b/setup.py
index 5de173b..0776c41 100644
--- a/setup.py
+++ b/setup.py
@@ -23,17 +23,12 @@ MODULES = (
)
REQUIREMENTS = list(open('requirements.txt'))
-if sys.version_info < (2, 6):
- REQUIREMENTS += ['simplejson']
if has_setuptools:
OPTIONS = {
'install_requires': REQUIREMENTS
}
else:
- if sys.version_info < (2, 6):
- warnings.warn('No setuptools installed. Be sure that you have '
- 'json or simplejson package installed')
OPTIONS = {}
AUTHOR_EMAIL = metadata['author']
@@ -61,7 +56,6 @@ CLASSIFIERS = [
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',