Browse Source

Incorrect version of the schema would not be detected

Gu1 10 years ago
parent
commit
0933833fcb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ispformat/validator/schemavalidator.py

+ 2 - 2
ispformat/validator/schemavalidator.py

@@ -53,8 +53,8 @@ def validate_isp(jdict):
     if not 'version' in jdict:
         raise ValidationError(u'version is a required property')
     try:
-        schema=_schema.versions.get(jdict['version'])
-    except (AttributeError, TypeError):
+        schema=_schema.versions[jdict['version']]
+    except (AttributeError, TypeError, KeyError):
         raise ValidationError(u'version %r unsupported'%jdict['version'])
 
     v=Draft4Validator(