Skip to content

Commit 34cd548

Browse files
committed
Don't allow None lookups in URIDict
1 parent 7c6aecb commit 34cd548

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jsonschema.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ class _URIDict(MutableMapping):
7979
"""
8080

8181
def normalize(self, uri):
82-
if uri is not None:
83-
return urlparse.urlsplit(uri).geturl()
82+
return urlparse.urlsplit(uri).geturl()
8483

8584
def __init__(self, *args, **kwargs):
8685
self.store = dict()
@@ -1275,6 +1274,6 @@ def _uniq(container):
12751274

12761275
def validate(instance, schema, cls=None, *args, **kwargs):
12771276
if cls is None:
1278-
cls = meta_schemas.get(schema.get("$schema"), Draft4Validator)
1277+
cls = meta_schemas.get(schema.get("$schema", ""), Draft4Validator)
12791278
cls.check_schema(schema)
12801279
cls(schema, *args, **kwargs).validate(instance)

0 commit comments

Comments
 (0)