Remove TokenState import for backward compatibility #1514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removes dependency on
google.auth.credentials.TokenState, which was introduced in google-auth v2.26.0.To maintain compatibility with earlier versions, replaces
TokenState.FRESHwith its equivalent hardcoded value1.Reference: https://github.com/googleapis/google-auth-library-python/blob/7c61c7d0a42ceec3eab693065745a74f524acab0/google/auth/credentials.py#L520
Fixes:
Could not load Google Cloud Storage bindings error when using google-auth < 2.26.0 with django-storages >= 1.14.6.
I give @martey all the credit for the solution (issue 1449)