Skip to content

Commit

Permalink
#173 Make changes py27 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcs committed May 11, 2016
1 parent 714446f commit 7c8a9b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions connexion/decorators/response.py
Expand Up @@ -65,8 +65,10 @@ def validate_response(self, data, status_code, headers):
raise NonConformingResponseBody(message=str(e))

if response_definition and response_definition.get("headers"):
response_definition_header_keys = response_definition.get("headers").keys()
missing_keys = response_definition_header_keys - headers.keys()
# converting to set is needed to support python 2.7
response_definition_header_keys = set(response_definition.get("headers").keys())
header_keys = set(headers.keys())
missing_keys = response_definition_header_keys - header_keys
if missing_keys:
pretty_list = ', '.join(missing_keys)
msg = ("Keys in header don't match response specification. "
Expand Down

0 comments on commit 7c8a9b0

Please sign in to comment.