diff options
Diffstat (limited to 'ghetto_json')
-rwxr-xr-x | ghetto_json | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ghetto_json b/ghetto_json index 075accb..60d8542 100755 --- a/ghetto_json +++ b/ghetto_json @@ -4,6 +4,11 @@ import json import sys import shlex +try: + import commentjson + json_load = commentjson.load +except ImportError: + json_load = json.load def main(params_list): params = dict(x.split("=", 2) for x in params_list) @@ -11,7 +16,7 @@ def main(params_list): changed = False with open(path) as f: - obj = json.load(f) + obj = json_load(f) for (key, target) in params.items(): parts = key.split('.') ref = obj |