Broken project to implement a cross-protocol browser in textual
http protocol: Make optional (depending if requests is installed)
| -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: |