Skip to content

Commit

Permalink
Merge pull request #174 from danielhollas/faster-import
Browse files Browse the repository at this point in the history
Lazy import urllib
  • Loading branch information
horejsek authored Sep 5, 2023
2 parents 7565400 + b8b954f commit b5e5a88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fastjsonschema/ref_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import re
from urllib import parse as urlparse
from urllib.parse import unquote
from urllib.request import urlopen

from .exceptions import JsonSchemaDefinitionException

Expand Down Expand Up @@ -59,6 +58,8 @@ def resolve_remote(uri, handlers):
if scheme in handlers:
result = handlers[scheme](uri)
else:
from urllib.request import urlopen

req = urlopen(uri)
encoding = req.info().get_content_charset() or 'utf-8'
try:
Expand Down

0 comments on commit b5e5a88

Please sign in to comment.