Skip to content

Commit 1ddc9e1

Browse files
author
e107109
committed
Updating the version of pyopenssl to 22.0.0
1 parent 020ccee commit 1ddc9e1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client_encryption/json_path_utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ def update_node(tree, path, node_str):
4040
node_json = node_str
4141

4242
if type(current_node) is list:
43-
if to_set in current_node[0] and type(current_node[0][to_set]) is dict and type(node_json) is dict:
44-
current_node[0][to_set].update(node_json)
45-
else:
46-
current_node[0][to_set] = node_json
43+
update_node_list(to_set, current_node, node_json)
4744
elif to_set in current_node and type(current_node[to_set]) is dict and type(node_json) is dict:
4845
current_node[to_set].update(node_json)
4946
else:
@@ -55,6 +52,13 @@ def update_node(tree, path, node_str):
5552
return tree
5653

5754

55+
def update_node_list(to_set, current_node, node_json):
56+
if to_set in current_node[0] and type(current_node[0][to_set]) is dict and type(node_json) is dict:
57+
current_node[0][to_set].update(node_json)
58+
else:
59+
current_node[0][to_set] = node_json
60+
61+
5862
def pop_node(tree, path):
5963
"""Retrieve and delete json or value given a path"""
6064

0 commit comments

Comments
 (0)