From edd55ec6fde6eecac09f0aa3aed636e56016bea9 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 27 Apr 2019 18:46:33 +0200 Subject: Allow object creation with no credentials whatsoever --- mastodon/Mastodon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index dce2081..6afab55 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -316,8 +316,6 @@ class Mastodon: raise MastodonIllegalArgumentError("Invalid ratelimit method.") # Token loading - if self.client_id is None and self.access_token is None: - raise MastodonIllegalArgumentError('No credentials were given.') if self.client_id is not None: if os.path.isfile(self.client_id): with open(self.client_id, 'r') as secret_file: @@ -2560,7 +2558,9 @@ class MastodonNotFoundError(MastodonAPIError): class MastodonUnauthorizedError(MastodonAPIError): """Raised when the mastodon API returns a 401 Unauthorized error - This happens when an OAuth token is invalid or has been revoked.""" + This happens when an OAuth token is invalid or has been revoked, + or when trying to access an endpoint that can't be used without + authentication without providing credentials.""" pass -- cgit v1.2.3