From 8848995b9322441335ff6681b2c72ecbff0b0d9f Mon Sep 17 00:00:00 2001 From: Ian Auld Date: Wed, 16 Mar 2016 22:15:58 -0700 Subject: [PATCH] Replaced dict comp with for loop for Python 2.6 compatibility --- moto/dynamodb2/responses.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moto/dynamodb2/responses.py b/moto/dynamodb2/responses.py index 752add148..6700f01c7 100644 --- a/moto/dynamodb2/responses.py +++ b/moto/dynamodb2/responses.py @@ -296,7 +296,9 @@ class DynamoHandler(BaseResponse): key_conditions = self.body.get('KeyConditions') if key_conditions: hash_key_name, range_key_name = dynamodb_backend2.get_table_keys_name(name, key_conditions.keys()) - filter_kwargs = {key: value for key, value in key_conditions.items() if key not in (hash_key_name, range_key_name)} + for key, value in key_conditions.items(): + if key not in (hash_key_name, range_key_name): + filter_kwargs[key] = value if hash_key_name is None: er = "'com.amazonaws.dynamodb.v20120810#ResourceNotFoundException" return self.error(er)