diff --git a/gcloud/datastore/helpers.py b/gcloud/datastore/helpers.py index 5f3965213729..ed1caf2071f9 100644 --- a/gcloud/datastore/helpers.py +++ b/gcloud/datastore/helpers.py @@ -7,7 +7,7 @@ from gcloud.datastore.key import Key -INT64 = Int64ValueChecker().CheckValue +INT_VALUE_CHECKER = Int64ValueChecker() def get_protobuf_attribute_and_value(val): @@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val): elif isinstance(val, float): name, value = 'double', val elif isinstance(val, (int, long)): - name, value = 'integer', INT64(val) + INT_VALUE_CHECKER.CheckValue(val) # This will raise an exception if invalid. + name, value = 'integer', long(val) # Always cast to a long. elif isinstance(val, basestring): name, value = 'string', val diff --git a/setup.py b/setup.py index 8543b46d0e54..2391d98758a8 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ REQUIREMENTS = [ 'httplib2', 'oauth2client', - 'protobuf', + 'protobuf >= 2.5.0', 'pycrypto', 'pyopenssl', 'pytz',