Skip to content
Snippets Groups Projects
Unverified Commit ad301241 authored by Dan Michael O. Heggø's avatar Dan Michael O. Heggø
Browse files

Change AssertUserFailedError

- Make `AssertUserFailedError` inherit `MwClientError` rather than `LoginError`, since it doesn't have the same args.
- Move message into args[0], which is more standard Python.
parent 9aa9eaf8
No related branches found
No related tags found
No related merge requests found
......@@ -65,18 +65,17 @@ class OAuthAuthorizationError(LoginError):
return self.info
class AssertUserFailedError(LoginError):
class AssertUserFailedError(MwClientError):
def __init__(self):
self.message = 'By default, mwclient protects you from ' + \
'accidentally editing without being logged in. If you ' + \
'actually want to edit without logging in, you can set ' + \
'force_login on the Site object to False.'
LoginError.__init__(self)
super(AssertUserFailedError, self).__init__(
'By default, mwclient protects you from accidentally editing ' +
'without being logged in. If you actually want to edit without ' +
'logging in, you can set force_login on the Site object to False.'
)
def __str__(self):
return self.message
return self.args[0]
class EmailError(MwClientError):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment