From 98557bb1fd0e11a7f20d914c6761f8137c96fa89 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 16 Dec 2015 03:19:20 -0800 Subject: [PATCH] compatibility with older python (eg 2.7.3) Summary: public `json.dump` does not have the same number of arguments in 2.7.3 and 2.7.9. Fix this by naming the optional parameters explicitly. Reviewed By: akotulski Differential Revision: D2760579 fb-gh-sync-id: 7ebc69e --- infer/lib/python/inferlib/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/infer/lib/python/inferlib/utils.py b/infer/lib/python/inferlib/utils.py index 923811b0b..fe2add660 100644 --- a/infer/lib/python/inferlib/utils.py +++ b/infer/lib/python/inferlib/utils.py @@ -142,9 +142,10 @@ def dump_json_to_path( encoding=config.LOCALE, # customized default=None, sort_keys=False, **kw): with codecs.open(path, 'w', encoding=config.LOCALE) as file_out: - json.dump(data, file_out, - skipkeys, ensure_ascii, check_circular, allow_nan, cls, - indent, separators, encoding, default, sort_keys, **kw) + json.dump(data, file_out, skipkeys=skipkeys, ensure_ascii=ensure_ascii, + check_circular=check_circular, allow_nan=allow_nan, cls=cls, + indent=indent, separators=separators, encoding=encoding, + default=default, sort_keys=sort_keys, **kw) def infer_version():