Skip to content

Commit 83ef3a7

Browse files
committed
move blasthttp import into request() to fix clean install import error
1 parent 2fec200 commit 83ef3a7

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cloudcheck/helpers.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import ipaddress
22
import os
33
import sys
4-
import asyncio
5-
import blasthttp
64
from pathlib import Path
75
from typing import List, Set, Union
86

@@ -205,11 +203,16 @@ def strings_to_cidrs(
205203
}
206204

207205

208-
_client = blasthttp.BlastHTTP()
206+
_client = None
209207

210208

211209
def request(url, include_api_key=False, browser_headers=False, timeout=60, **kwargs):
212-
global _warned_missing_api_key
210+
import asyncio
211+
import blasthttp
212+
213+
global _warned_missing_api_key, _client
214+
if _client is None:
215+
_client = blasthttp.BlastHTTP()
213216
headers = kwargs.get("headers", {})
214217
if browser_headers:
215218
headers.update(browser_base_headers)

0 commit comments

Comments
 (0)