Skip to content

Commit

Permalink
fix for issue #354 (#356)
Browse files Browse the repository at this point in the history
* fix for issue #354

* catch OSError instead of FileExistsError, since FileExistsError is not available in python 2.7
  • Loading branch information
tedchamb committed Aug 13, 2020
1 parent a1988c8 commit 85bd417
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion azure-devops/azure/devops/_file_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ def get_cache_dir():
azure_devops_cache_dir = os.getenv('AZURE_DEVOPS_CACHE_DIR', None)\
or os.path.expanduser(os.path.join('~', '.azure-devops', 'python-sdk', 'cache'))
if not os.path.exists(azure_devops_cache_dir):
os.makedirs(azure_devops_cache_dir)
try:
os.makedirs(azure_devops_cache_dir)
except OSError:
# https://github.com/microsoft/azure-devops-python-api/issues/354
# FileExistsError is not available in python 2.7
if not os.path.exists(azure_devops_cache_dir):
raise
return azure_devops_cache_dir


Expand Down

0 comments on commit 85bd417

Please sign in to comment.