From c4e1d126b270b191ce81ab8625c8757458149dfc Mon Sep 17 00:00:00 2001 From: michaelp Date: Fri, 30 Sep 2016 16:24:20 -0400 Subject: [PATCH] made cross python-platform --- voluptuous/schema_builder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/voluptuous/schema_builder.py b/voluptuous/schema_builder.py index 74767da..78f9f8b 100644 --- a/voluptuous/schema_builder.py +++ b/voluptuous/schema_builder.py @@ -615,11 +615,13 @@ def key_literal(key): # build a map that takes the key literals to the needed objects # literal -> Required|Optional|literal - result_key_map = {key_literal(key): key for key in result} + result_key_map = dict() + for key in result: + result_key_map[key_literal(key)] = key # for each item in the extension schema, replace duplicates # or add new keys - for key, value in schema.iteritems(): + for key, value in iteritems(schema): # if the key is already in the dictionary, we need to replace it # transform key to literal before checking presence