aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/grpcio/py2/patches/21-support-python-3.11.patch
blob: 0540d852ad3ae00d06c606318a2ea2364a2b0fba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
commit 818d1471d7da1a1d857d83ce116551518e3641c6
author: shadchin
date: 2022-12-31T17:47:26+03:00

    Fix grpcio

--- a/src/python/grpcio/grpc/_auth.py	(4db089c5339d6c005f207b765616aee8fae74d0b)
+++ b/src/python/grpcio/grpc/_auth.py	(818d1471d7da1a1d857d83ce116551518e3641c6)
@@ -14,6 +14,7 @@
 """GRPCAuthMetadataPlugins for standard authentication."""
 
 import inspect
+import sys
 
 import grpc

@@ -31,8 +31,11 @@
         self._credentials = credentials
         # Hack to determine if these are JWT creds and we need to pass
         # additional_claims when getting a token
-        self._is_jwt = 'additional_claims' in inspect.getfullargspec(
-            credentials.get_access_token).args
+        if sys.version_info[0] == 2:
+            args = inspect.getargspec(credentials.get_access_token).args
+        else:
+            args = inspect.getfullargspec(credentials.get_access_token).args
+        self._is_jwt = 'additional_claims' in args
 
     def __call__(self, context, callback):
         try: