21-support-python-3.11.patch 1018 B

123456789101112131415161718192021222324252627282930
  1. commit 818d1471d7da1a1d857d83ce116551518e3641c6
  2. author: shadchin
  3. date: 2022-12-31T17:47:26+03:00
  4. Fix grpcio
  5. --- a/src/python/grpcio/grpc/_auth.py (4db089c5339d6c005f207b765616aee8fae74d0b)
  6. +++ b/src/python/grpcio/grpc/_auth.py (818d1471d7da1a1d857d83ce116551518e3641c6)
  7. @@ -14,6 +14,7 @@
  8. """GRPCAuthMetadataPlugins for standard authentication."""
  9. import inspect
  10. +import sys
  11. import grpc
  12. @@ -31,8 +31,11 @@
  13. self._credentials = credentials
  14. # Hack to determine if these are JWT creds and we need to pass
  15. # additional_claims when getting a token
  16. - self._is_jwt = 'additional_claims' in inspect.getfullargspec(
  17. - credentials.get_access_token).args
  18. + if sys.version_info[0] == 2:
  19. + args = inspect.getargspec(credentials.get_access_token).args
  20. + else:
  21. + args = inspect.getfullargspec(credentials.get_access_token).args
  22. + self._is_jwt = 'additional_claims' in args
  23. def __call__(self, context, callback):
  24. try: