Skip to content

Commit fd9cd02

Browse files
committed
Use 'invoke' rather than 'get' followed by call to invoke factories.
1 parent b3233aa commit fd9cd02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcloud/datastore/_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _get_value_from_value_pb(value_pb):
148148
result = naive.replace(tzinfo=pytz.utc)
149149

150150
elif value_pb.HasField('key_value'):
151-
result = _FACTORIES.get('Key_from_protobuf')(value_pb.key_value)
151+
result = _FACTORIES.invoke('Key_from_protobuf', value_pb.key_value)
152152

153153
elif value_pb.HasField('boolean_value'):
154154
result = value_pb.boolean_value
@@ -166,7 +166,8 @@ def _get_value_from_value_pb(value_pb):
166166
result = value_pb.blob_value
167167

168168
elif value_pb.HasField('entity_value'):
169-
result = _FACTORIES.get('Entity_from_protobuf')(value_pb.entity_value)
169+
result = _FACTORIES.invoke(
170+
'Entity_from_protobuf', value_pb.entity_value)
170171

171172
elif value_pb.list_value:
172173
result = [_get_value_from_value_pb(x) for x in value_pb.list_value]

0 commit comments

Comments
 (0)