Skip to content

Commit

Permalink
Ignore error if cache file doesn't exist (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcrone authored Nov 18, 2020
1 parent e2d9997 commit a522077
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gdrivefs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, root_file_id=None, token="browser",
:param token: str
One of "anon", "browser", "cache". Using "browser" will prompt a URL to
be put in a browser, and cache the response for future use with token="cache".
"browser" remove any previously cached value.
"browser" will remove any previously cached token file if it exists.
:param access: str
One of "full_control", "read_only
:param spaces:
Expand Down Expand Up @@ -85,7 +85,10 @@ def connect(self, method=None):
self.service = srv.files()

def _connect_browser(self):
os.remove(pydata_google_auth.cache.READ_WRITE._path)
try:
os.remove(pydata_google_auth.cache.READ_WRITE._path)
except OSError:
pass
return self._connect_cache()

def _connect_cache(self):
Expand Down

0 comments on commit a522077

Please sign in to comment.