aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-04-27 18:46:33 +0200
committerLorenz Diener <[email protected]>2019-04-27 18:46:33 +0200
commitedd55ec6fde6eecac09f0aa3aed636e56016bea9 (patch)
treecfc6e65b007f883bc24184bff0c7d299c3ee7e2e /mastodon/Mastodon.py
parentecdaecf17a96d5e9f6bbede17fe9f12c800d75ec (diff)
downloadmastodon.py-edd55ec6fde6eecac09f0aa3aed636e56016bea9.tar.gz
Allow object creation with no credentials whatsoever
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py6
1 files 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:
316 raise MastodonIllegalArgumentError("Invalid ratelimit method.") 316 raise MastodonIllegalArgumentError("Invalid ratelimit method.")
317 317
318 # Token loading 318 # Token loading
319 if self.client_id is None and self.access_token is None:
320 raise MastodonIllegalArgumentError('No credentials were given.')
321 if self.client_id is not None: 319 if self.client_id is not None:
322 if os.path.isfile(self.client_id): 320 if os.path.isfile(self.client_id):
323 with open(self.client_id, 'r') as secret_file: 321 with open(self.client_id, 'r') as secret_file:
@@ -2560,7 +2558,9 @@ class MastodonNotFoundError(MastodonAPIError):
2560class MastodonUnauthorizedError(MastodonAPIError): 2558class MastodonUnauthorizedError(MastodonAPIError):
2561 """Raised when the mastodon API returns a 401 Unauthorized error 2559 """Raised when the mastodon API returns a 401 Unauthorized error
2562 2560
2563 This happens when an OAuth token is invalid or has been revoked.""" 2561 This happens when an OAuth token is invalid or has been revoked,
2562 or when trying to access an endpoint that can't be used without
2563 authentication without providing credentials."""
2564 pass 2564 pass
2565 2565
2566 2566
Powered by cgit v1.2.3 (git 2.41.0)