Skip to content

Commit dcba969

Browse files
committed
get rid of try catch
Signed-off-by: wiseaidev <[email protected]>
1 parent 635bab0 commit dcba969

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

aredis_om/model/model.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1199,11 +1199,9 @@ def to_string(s):
11991199
)
12001200
)
12011201

1202-
try:
1203-
fields["json"] = fields["$"]
1204-
del fields["$"]
1205-
except KeyError:
1206-
pass
1202+
if fields.get("$"):
1203+
fields["json"] = fields.get("$")
1204+
fields.pop("$")
12071205

12081206
if "json" in fields:
12091207
json_fields = json.loads(fields["json"])

0 commit comments

Comments
 (0)