-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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() condition in contrib. #2942
Conversation
python/tvm/contrib/download.py
Outdated
@@ -59,7 +59,7 @@ def download(url, path, overwrite=False, size_compare=False, verbose=1, retries= | |||
# Stateful start time | |||
start_time = time.time() | |||
dirpath = os.path.dirname(path) | |||
if not os.path.isdir(dirpath): | |||
if not os.path.isdir(dirpath) and not dirpath is '': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use not dirpath
to check whether a string is empty.
Could you also put the non-empty check before the os.path.isdir
check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as desired. There are other ways to check if empty too.
Thanks @cbalint13 |
This fix contrib.download when only the filename is specified as destination.