Skip to content

Commit

Permalink
Fix issue where cache directory was not recursively created #166
Browse files Browse the repository at this point in the history
  • Loading branch information
matlink committed Mar 8, 2018
1 parent cfbd969 commit d8aed76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gplaycli/gplaycli.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def download(self, pkg_todownload):
# Check for download folder
download_folder = self.download_folder
if not os.path.isdir(download_folder):
os.mkdir(download_folder)
os.makedirs(download_folder, exist_ok=True)

# Download
try:
Expand Down Expand Up @@ -440,7 +440,7 @@ def write_cached_token(self, token, gsfid):
# creates cachedir if not exists
cachedir = os.path.dirname(self.tokencachefile)
if not os.path.exists(cachedir):
os.mkdir(cachedir)
os.makedirs(cachedir, exist_ok=True)
with open(self.tokencachefile, 'w') as tcf:
tcf.write("%s %s" % (token, gsfid))
except IOError as io_error:
Expand Down

0 comments on commit d8aed76

Please sign in to comment.