refactor: delay urllib loading

This commit is contained in:
Daylin Morgan 2023-08-21 09:10:53 -05:00
parent 19c39ad471
commit 3031e5fb7f
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -52,10 +52,8 @@ from typing import (
Type, Type,
Union, Union,
) )
from urllib.error import HTTPError
from urllib.request import urlopen
__version__ = "23.8b1-4-g3bf000f-dev" __version__ = "23.8b1-6-g19c39ad-dev"
class Spinner: class Spinner:
@ -1120,6 +1118,9 @@ def resolve_deps(reqs: List[str], requirements: Path) -> List[str]:
def fetch_script(url: str) -> str: def fetch_script(url: str) -> str:
from urllib.error import HTTPError # noqa
from urllib.request import urlopen # noqa
try: try:
log.debug(f"fetching from remote url: {url}") log.debug(f"fetching from remote url: {url}")
r = urlopen(url) r = urlopen(url)