jenkins-bot has submitted this change and it was merged.
Change subject: API pyflakes ......................................................................
API pyflakes
- APIWarning, subclass of UserWarning, was never utilised. - use of warnings module removed in 2008, two months after being introduced. r6171 - import of urllib module not needed after April 2014 changeset Ib3ff27f5f41f2236eb5510c96751936ac7e98f1e
Change-Id: I78c72a2c564133ed88ac7c87809206edf6dab68d --- M pywikibot/data/api.py 1 file changed, 2 insertions(+), 10 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index f7ad4c5..af5628b 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -16,7 +16,6 @@ import datetime import hashlib import json -import logging import mimetypes import os try: @@ -27,12 +26,10 @@ import re import traceback import time -import urllib -import warnings
import pywikibot from pywikibot import config, login -from pywikibot.exceptions import * +from pywikibot.exceptions import Server504Error, FatalServerError, Error
import sys
@@ -62,11 +59,6 @@
def __str__(self): return "%(code)s: %(info)s" % self.__dict__ - - -class APIWarning(UserWarning): - """The API returned a warning message.""" - pass
class TimeoutError(pywikibot.Error): @@ -316,7 +308,7 @@ pywikibot.error(traceback.format_exc()) raise # TODO: what other exceptions can occur here? - except Exception as e: + except Exception: # for any other error on the http request, wait and retry pywikibot.error(traceback.format_exc()) pywikibot.log(u"%s, %s" % (uri, paramstring))
pywikibot-commits@lists.wikimedia.org