parse_or_none(raw) returning the parsed object, or None when raw is not valid JSON — catching json.JSONDecodeError specifically, not bare Exception.parse_or_none('[1, 2]')[1, 2]
Valid JSON parses normally.
parse_or_none('{oops}')None
The decode error is absorbed.
JSONDecodeError lives on the json module.
One try/except around loads.