Merge pull request #52 from haypo/signature
Use inspect.signature() on Python 3
This commit is contained in:
@@ -105,8 +105,11 @@ def get_loadjson():
|
|||||||
function with object_pairs_hook set to multidict for Python versions that
|
function with object_pairs_hook set to multidict for Python versions that
|
||||||
support the parameter. """
|
support the parameter. """
|
||||||
|
|
||||||
argspec = inspect.getargspec(json.load)
|
if sys.version_info >= (3, 3):
|
||||||
if 'object_pairs_hook' not in argspec.args:
|
args = inspect.signature(json.load).parameters
|
||||||
|
else:
|
||||||
|
args = inspect.getargspec(json.load).args
|
||||||
|
if 'object_pairs_hook' not in args:
|
||||||
return json.load
|
return json.load
|
||||||
|
|
||||||
return functools.partial(json.load, object_pairs_hook=multidict)
|
return functools.partial(json.load, object_pairs_hook=multidict)
|
||||||
|
|||||||
Reference in New Issue
Block a user