Skip to content

Commit 20339a5

Browse files
committed
Fix #215: Helper for int and double now work as expected.
1 parent 1779aec commit 20339a5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

gcloud/datastore/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from gcloud.datastore.key import Key
99

10-
INT64 = Int64ValueChecker().CheckValue
10+
check_int64_value = Int64ValueChecker().CheckValue
1111

1212

1313
def get_protobuf_attribute_and_value(val):
@@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val):
5656
elif isinstance(val, float):
5757
name, value = 'double', val
5858
elif isinstance(val, (int, long)):
59-
name, value = 'integer', INT64(val)
59+
check_int64_value(val) # This will raise an exception if invalid.
60+
name, value = 'integer', val
6061
elif isinstance(val, basestring):
6162
name, value = 'string', val
6263

0 commit comments

Comments
 (0)