summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2017-10-21 10:40:13 +0200
committerStefan Kögl <stefan@skoegl.net>2017-10-21 10:44:59 +0200
commit7079bdc7bf4be53f51fa30d790c32db83dd8c210 (patch)
treeaed196232a285f0f0f925cf4618212b7e35b39d2
parent4351804bc88254fe2ae9dccf4d081e25f3a266f9 (diff)
downloadpython-json-patch-7079bdc7bf4be53f51fa30d790c32db83dd8c210.tar.gz
Remove support for Python 2.6
-rw-r--r--jsonpatch.py22
-rw-r--r--setup.py6
2 files changed, 3 insertions, 25 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index cee4820..e1a5b2d 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -96,25 +96,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',