Skip to content

Commit

Permalink
fix(json_parser): fixing the "TypeError('the JSON object must be str,…
Browse files Browse the repository at this point in the history
… bytes or bytearray, not dict')" after a json_fix is successful
  • Loading branch information
fabricehong committed Apr 5, 2023
1 parent 62dfd84 commit 051be4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def fix_json(json_str: str, schema: str, debug=False) -> str:
print(f"Fixed JSON: {result_string}")
print("----------- END OF FIX ATTEMPT ----------------")
try:
return json.loads(result_string)
json.loads(result_string) # just check the validity
return result_string
except:
# Get the call stack:
# import traceback
Expand Down

0 comments on commit 051be4d

Please sign in to comment.