From 0f0de2b4adc51b7a6bce9827ea96bfed7533bc20 Mon Sep 17 00:00:00 2001 From: Sachin Bansal Date: Tue, 9 Jun 2015 17:33:25 -0700 Subject: [PATCH] Python 2.6 doesn't have dictionary comprehension Use constructor instead of comprehension Change-Id: Icec78d946ab6cd4a190715d4835a392fbae5fefb Closes-Bug: 1463624 --- src/api-lib/vnc_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-lib/vnc_api.py b/src/api-lib/vnc_api.py index 1ff44f78674..06d91453573 100644 --- a/src/api-lib/vnc_api.py +++ b/src/api-lib/vnc_api.py @@ -34,8 +34,8 @@ def str_to_class(class_name): def compare_refs(old_refs, new_refs): # compare refs in an object - old_ref_dict = {':'.join(ref['to']): ref['attr'] for ref in old_refs} - new_ref_dict = {':'.join(ref['to']): ref['attr'] for ref in new_refs} + old_ref_dict = dict((':'.join(ref['to']), ref['attr']) for ref in old_refs) + new_ref_dict = dict((':'.join(ref['to']), ref['attr']) for ref in new_refs) return old_ref_dict == new_ref_dict # end compare_refs