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
master
Jules Villard 9 years ago committed by facebook-github-bot-7
parent 7a0c9c88bd
commit 98557bb1fd

@ -142,9 +142,10 @@ def dump_json_to_path(
encoding=config.LOCALE, # customized encoding=config.LOCALE, # customized
default=None, sort_keys=False, **kw): default=None, sort_keys=False, **kw):
with codecs.open(path, 'w', encoding=config.LOCALE) as file_out: with codecs.open(path, 'w', encoding=config.LOCALE) as file_out:
json.dump(data, file_out, json.dump(data, file_out, skipkeys=skipkeys, ensure_ascii=ensure_ascii,
skipkeys, ensure_ascii, check_circular, allow_nan, cls, check_circular=check_circular, allow_nan=allow_nan, cls=cls,
indent, separators, encoding, default, sort_keys, **kw) indent=indent, separators=separators, encoding=encoding,
default=default, sort_keys=sort_keys, **kw)
def infer_version(): def infer_version():

Loading…
Cancel
Save