diff --git a/earwigbot/commands/editcount.py b/earwigbot/commands/editcount.py index 13dad27..0642ad4 100644 --- a/earwigbot/commands/editcount.py +++ b/earwigbot/commands/editcount.py @@ -22,6 +22,7 @@ from urllib import quote_plus +from earwigbot import exceptions from earwigbot import wiki from earwigbot.commands import BaseCommand @@ -46,7 +47,7 @@ class Command(BaseCommand): try: count = user.editcount - except wiki.UserNotFoundError: + except earwigbot.UserNotFoundError: msg = "the user \x0302{0}\x0301 does not exist." self.reply(data, msg.format(name)) return diff --git a/earwigbot/commands/registration.py b/earwigbot/commands/registration.py index 913ca33..de54e94 100644 --- a/earwigbot/commands/registration.py +++ b/earwigbot/commands/registration.py @@ -22,6 +22,7 @@ import time +from earwigbot import exceptions from earwigbot import wiki from earwigbot.commands import BaseCommand @@ -46,7 +47,7 @@ class Command(BaseCommand): try: reg = user.registration - except wiki.UserNotFoundError: + except exceptions.UserNotFoundError: msg = "the user \x0302{0}\x0301 does not exist." self.reply(data, msg.format(name)) return diff --git a/earwigbot/commands/rights.py b/earwigbot/commands/rights.py index 1ccb1ca..1f6b671 100644 --- a/earwigbot/commands/rights.py +++ b/earwigbot/commands/rights.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from earwigbot import exceptions from earwigbot import wiki from earwigbot.commands import BaseCommand @@ -44,7 +45,7 @@ class Command(BaseCommand): try: rights = user.groups - except wiki.UserNotFoundError: + except exceptions.UserNotFoundError: msg = "the user \x0302{0}\x0301 does not exist." self.reply(data, msg.format(name)) return diff --git a/earwigbot/tasks/__init__.py b/earwigbot/tasks/__init__.py index ba604b0..2ecbbce 100644 --- a/earwigbot/tasks/__init__.py +++ b/earwigbot/tasks/__init__.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from earwigbot import exceptions from earwigbot import wiki __all__ = ["BaseTask"] @@ -122,7 +123,7 @@ class BaseTask(object): try: content = page.get() - except wiki.PageNotFoundError: + except exceptions.PageNotFoundError: return False if content == cfg.get("disabled", "run"): return False diff --git a/earwigbot/tasks/afc_statistics.py b/earwigbot/tasks/afc_statistics.py index e29913c..a2ada55 100644 --- a/earwigbot/tasks/afc_statistics.py +++ b/earwigbot/tasks/afc_statistics.py @@ -28,6 +28,7 @@ from time import sleep import oursql +from earwigbot import exceptions from earwigbot import wiki from earwigbot.tasks import BaseTask @@ -470,7 +471,7 @@ class Task(BaseTask): else: try: ns = self.site.namespace_name_to_id(namespace) - except wiki.NamespaceNotFoundError: + except exceptions.NamespaceNotFoundError: base = title ns = wiki.NS_MAIN @@ -720,7 +721,7 @@ class Task(BaseTask): try: if submitter.blockinfo: notes += "|nb=1" # Submitter is blocked - except wiki.UserNotFoundError: # Likely an IP + except exceptions.UserNotFoundError: # Likely an IP pass return notes