Skip to content

Commit

Permalink
be more tolerant of blank lines and whitespace between objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjonbrazil committed Jan 15, 2023
1 parent a75f937 commit 3b47f6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jtbl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def get_json(json_data, columns=None):
data_list = []
for i, jsonline in enumerate(data):
try:
entry = json.loads(jsonline)
data_list.append(entry)
if jsonline.strip():
entry = json.loads(jsonline)
data_list.append(entry)
except Exception as e:
# can't parse the data. Throw a nice message and quit
return (ERROR, textwrap.dedent(f'''\
Expand Down

0 comments on commit 3b47f6d

Please sign in to comment.