Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix makedirs checking #2264

Merged
merged 3 commits into from Feb 13, 2017
Merged

Fix makedirs checking #2264

merged 3 commits into from Feb 13, 2017

Conversation

okuta
Copy link
Member

@okuta okuta commented Feb 13, 2017

Sometimes makedirs is failed.
This PR fixed it.

@okuta okuta added the cat:bug Bug report or fix. label Feb 13, 2017
@@ -138,7 +138,7 @@ def compile_with_cache(source, options=(), arch=None, cache_dir=None):
mod = function.Module()

if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
os.makedirs(cache_dir, exist_ok=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This argument is only supported python3.
https://docs.python.jp/3/library/os.html#os.makedirs

@unnonouno unnonouno self-assigned this Feb 13, 2017
try:
os.makedirs(cache_dir)
except OSError:
if not os.path.exists(cache_dir):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use os.path.isdir

@okuta okuta changed the title Use makedirs with exist_ok=True Fix makedirs checking Feb 13, 2017
@unnonouno unnonouno merged commit 53c075d into master Feb 13, 2017
@unnonouno unnonouno deleted the makedirs branch February 13, 2017 11:51
@unnonouno
Copy link
Member

LGTM

@unnonouno unnonouno added this to the v1.21.0 milestone Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:bug Bug report or fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants