Skip to content

Commit

Permalink
code-style: update json CB
Browse files Browse the repository at this point in the history
To avoid too-many-branches in next review.
  • Loading branch information
cpaillet committed Jan 9, 2025
1 parent c115896 commit bdd8253
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions consul/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ def cb(response):
item[decode] = base64.b64decode(item[decode])
if is_id:
data = data["ID"]
if one:
if data == []:
data = None
if data is not None:
data = data[0]
if one and isinstance(data, list):
data = data[0] if data else None
if postprocess:
data = postprocess(data)
if index:
Expand Down

0 comments on commit bdd8253

Please sign in to comment.