dont create current dir

This commit is contained in:
j 2014-12-09 13:11:09 +01:00
parent 34a48e6e68
commit 79df151729
2 changed files with 2 additions and 2 deletions

View file

@ -121,7 +121,7 @@ get_url=read_url
def save_url(url, filename, overwrite=False):
if not os.path.exists(filename) or overwrite:
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
data = read_url(url)
with open(filename, 'wb') as f:

View file

@ -113,7 +113,7 @@ get_url=read_url
def save_url(url, filename, overwrite=False):
if not os.path.exists(filename) or overwrite:
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
data = read_url(url)
with open(filename, 'wb') as f: