Skip to content

Commit

Permalink
raise on login failures
Browse files Browse the repository at this point in the history
  • Loading branch information
fastily committed Nov 27, 2023
1 parent 1d587cf commit 27938c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pwiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __init__(self, domain: str = "en.wikipedia.org", username: str = None, passw

self._refresh_rights()

if not self._load_cookies(username):
self.login(username, password)
if username and not (self._load_cookies(username) or self.login(username, password)):
raise RuntimeError(f"Failed to login for '{username}'!")

self.ns_manager: NSManager = OQuery.fetch_namespaces(self)

Expand Down

0 comments on commit 27938c6

Please sign in to comment.