summary refs log tree commit diff
path: root/protocol/http.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2023-01-28 10:03:51 -0500
committerZach DeCook <zachdecook@librem.one>2023-01-28 10:03:51 -0500
commit92875ee6e1a9faa00f9f1e9c6c689a193179635e (patch)
tree6f3a61d657adba290bfc9e17c95eabddca4b29fa /protocol/http.py
parent45cd6314749a563ba9650ba0a322050e524a93b8 (diff)
downloadbrowset-92875ee6e1a9faa00f9f1e9c6c689a193179635e.tar.gz
http protocol: Make optional (depending if requests is installed)
Diffstat (limited to 'protocol/http.py')
-rw-r--r--protocol/http.py7
1 files changed, 6 insertions, 1 deletions
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: