diff options
Diffstat (limited to 'boto/dynamodb/layer2.py')
-rw-r--r-- | boto/dynamodb/layer2.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/boto/dynamodb/layer2.py b/boto/dynamodb/layer2.py index f0daca15..4e430b2d 100644 --- a/boto/dynamodb/layer2.py +++ b/boto/dynamodb/layer2.py @@ -181,13 +181,15 @@ class Layer2(object): """ dynamodb_key = {} dynamodb_value = dynamize_value(hash_key) - if dynamodb_value.keys()[0] != schema.hash_key_type: + keys = list(dynamodb_value.keys()) + if keys[0] != schema.hash_key_type: msg = 'Hashkey must be of type: %s' % schema.hash_key_type raise TypeError(msg) dynamodb_key['HashKeyElement'] = dynamodb_value if range_key is not None: dynamodb_value = dynamize_value(range_key) - if dynamodb_value.keys()[0] != schema.range_key_type: + keys = list(dynamodb_value.keys()) + if keys[0] != schema.range_key_type: msg = 'RangeKey must be of type: %s' % schema.range_key_type raise TypeError(msg) dynamodb_key['RangeKeyElement'] = dynamodb_value |