jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1035850?usp=email )
Change subject: Raise import error and add appropriate message ......................................................................
Raise import error and add appropriate message
Bug: T353387 Change-Id: I93d1c8ce96e37a25973b35ddfd3767226d82fe68 --- M pywikibot/comms/http.py 1 file changed, 2 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 44447e2..65f1333 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -433,9 +433,8 @@ auth = get_authentication(uri) if auth is not None and len(auth) == 4: if isinstance(requests_oauthlib, ImportError): - warn(str(requests_oauthlib), ImportWarning) - error(f'OAuth authentication not supported: {requests_oauthlib}') - auth = None + pywikibot.error(requests_oauthlib) + sys.exit(1) else: auth = requests_oauthlib.OAuth1(*auth)