Skip to content

Commit c89d6bd

Browse files
author
Jon Wayne Parrott
authored
Merge pull request #655 from GoogleCloudPlatform/httplib2_fix
fixed discovery build by removing http
2 parents 7d287e5 + 0841cdb commit c89d6bd

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

samples/snippets/api/analyze.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,12 @@
2121
import sys
2222

2323
from googleapiclient import discovery
24-
import httplib2
2524
from oauth2client.client import GoogleCredentials
2625

2726

2827
def get_service():
2928
credentials = GoogleCredentials.get_application_default()
30-
scoped_credentials = credentials.create_scoped(
31-
['https://www.googleapis.com/auth/cloud-platform'])
32-
http = httplib2.Http()
33-
scoped_credentials.authorize(http)
3429
return discovery.build('language', 'v1',
35-
http=http,
3630
credentials=credentials)
3731

3832

samples/snippets/movie_nl/main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
from googleapiclient import discovery
2323
from googleapiclient.errors import HttpError
24-
import httplib2
2524
from oauth2client.client import GoogleCredentials
2625
import requests
2726

@@ -280,12 +279,7 @@ def get_service():
280279
"""Build a client to the Google Cloud Natural Language API."""
281280

282281
credentials = GoogleCredentials.get_application_default()
283-
scoped_credentials = credentials.create_scoped(
284-
['https://www.googleapis.com/auth/cloud-platform'])
285-
http = httplib2.Http()
286-
scoped_credentials.authorize(http)
287282
return discovery.build('language', 'v1',
288-
http=http,
289283
credentials=credentials)
290284

291285

0 commit comments

Comments
 (0)