From 92875ee6e1a9faa00f9f1e9c6c689a193179635e Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 28 Jan 2023 10:03:51 -0500 Subject: http protocol: Make optional (depending if requests is installed) --- protocol/http.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocol/http.py') diff --git a/protocol/http.py b/protocol/http.py index 96428f9..b3416e9 100644 --- a/protocol/http.py +++ b/protocol/http.py @@ -1,4 +1,9 @@ -import requests +try: + import requests +except ImportError: + class requests(): + def get(url, timeout): + raise ImportError("ImportError: Please install requests library to make HTTP/s requests.") class HttpProtocol(): def get(url): try: -- cgit 1.4.1