more fixes for 2.6 and 3

This commit is contained in:
Peter Gorniak 2016-12-07 13:55:26 -08:00
parent 0c875fd268
commit 114de9ba0b

View File

@ -286,8 +286,8 @@ class DynamoHandler(BaseResponse):
index_hash_key = [key for key in index if key['KeyType'] == 'HASH'][0] index_hash_key = [key for key in index if key['KeyType'] == 'HASH'][0]
hash_key_var = reverse_attribute_lookup.get(index_hash_key['AttributeName'], index_hash_key['AttributeName']) hash_key_var = reverse_attribute_lookup.get(index_hash_key['AttributeName'], index_hash_key['AttributeName'])
hash_key_regex = r'(^|[\s(]){}\b'.format(hash_key_var) hash_key_regex = r'(^|[\s(]){0}\b'.format(hash_key_var)
i, hash_key_expression = ((i, e) for i, e in enumerate(expressions) if re.search(hash_key_regex, e)).next() i, hash_key_expression = next((i, e) for i, e in enumerate(expressions) if re.search(hash_key_regex, e))
hash_key_expression = hash_key_expression.strip('()') hash_key_expression = hash_key_expression.strip('()')
expressions.pop(i) expressions.pop(i)