From ad7deaa5e6bc2a2ef5a02407ee4491a1f099aeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E6=9C=88=E7=A7=8B=E8=A7=81=E5=BF=83?= Date: Fri, 29 May 2020 00:36:28 +0800 Subject: [PATCH] Support proxy Support proxy --- pydrive/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pydrive/auth.py b/pydrive/auth.py index e0b7e58..c8cb941 100644 --- a/pydrive/auth.py +++ b/pydrive/auth.py @@ -504,8 +504,10 @@ def Authenticate(self, code): """ if self.flow is None: self.GetFlow() + if self.http is None: + self.http = httplib2.Http(timeout=self.http_timeout) try: - self.credentials = self.flow.step2_exchange(code) + self.credentials = self.flow.step2_exchange(code, http=self.http) except FlowExchangeError as e: raise AuthenticationError('OAuth2 code exchange failed: %s' % e) print('Authentication successful.')