From: Alexander Cecile Date: Fri, 28 Aug 2020 05:51:14 +0000 (-0400) Subject: Changed dependency-related exception to be compatible with Python versions < 3.6 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=59ddd34d0edce556289bb9bdf8f1cabe1e41014b;p=stevenblack-hosts.git Changed dependency-related exception to be compatible with Python versions < 3.6 --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 2c50b4c37..6a2ec9d87 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -30,9 +30,9 @@ if not PY3: try: import requests -except ModuleNotFoundError: # noqa: F821 - raise ModuleNotFoundError("This project's dependencies have changed. The Requests library (" # noqa: F821 - "https://requests.readthedocs.io/en/master/) is now required.") +except ImportError: + raise ImportError("This project's dependencies have changed. The Requests library (" + "https://requests.readthedocs.io/en/master/) is now required.") # Syntactic sugar for "sudo" command in UNIX / Linux