diff --git a/scripts/knotctl b/scripts/knotctl index 5a99bc1..000aaad 100755 --- a/scripts/knotctl +++ b/scripts/knotctl @@ -14,9 +14,12 @@ from urllib.parse import urlparse import argcomplete import requests import yaml -from requests.exceptions import JSONDecodeError as RequestsJSONDecodeError from requests.models import HTTPBasicAuth from simplejson.errors import JSONDecodeError as SimplejsonJSONDecodeError +try: + from requests.exceptions import JSONDecodeError as RequestsJSONDecodeError +except ImportError: + from requests.exceptions import InvalidJSONError as RequestsJSONDecodeError # Helper functions