diff options
| author | Zach DeCook <zachdecook@librem.one> | 2023-01-28 10:03:51 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2023-01-28 10:03:51 -0500 |
| commit | 92875ee6e1a9faa00f9f1e9c6c689a193179635e (patch) | |
| tree | 6f3a61d657adba290bfc9e17c95eabddca4b29fa /protocol/http.py | |
| parent | 45cd6314749a563ba9650ba0a322050e524a93b8 (diff) | |
| download | browset-92875ee6e1a9faa00f9f1e9c6c689a193179635e.tar.gz | |
http protocol: Make optional (depending if requests is installed)
Diffstat (limited to 'protocol/http.py')
| -rw-r--r-- | protocol/http.py | 7 |
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: |
