From 2feafab02c28fde70e757bf83321e115b10b5f75 Mon Sep 17 00:00:00 2001 From: max-kov Date: Sun, 1 Oct 2017 00:35:52 +0100 Subject: [PATCH] Switched from tools.run() to tools.run_flow() https://stackoverflow.com/questions/35115130/oauth2-lib-cannot-import-name-run --- gmailMessageCounter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmailMessageCounter.py b/gmailMessageCounter.py index 1de5864..a7ced7a 100644 --- a/gmailMessageCounter.py +++ b/gmailMessageCounter.py @@ -5,7 +5,7 @@ from apiclient.discovery import build from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage -from oauth2client.tools import run +from oauth2client import tools CLIENT_SECRET_FILE = 'client_secret_.apps.googleusercontent.com.json' STORAGE = Storage('gmail.storage') @@ -20,7 +20,7 @@ def build_service(): http = httplib2.Http() credentials = STORAGE.get() if credentials is None or credentials.invalid: - credentials = run(flow, STORAGE, http=http) + credentials = tools.run_flow(flow, STORAGE, http=http) http = credentials.authorize(http) return build('gmail', 'v1', http=http)