1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 19:36:50 +01:00

Fix os.makedirs in Windows

This commit is contained in:
Philipp Hagemeister 2011-09-06 17:56:05 +02:00
parent eb99a7ee5f
commit e5e74ffb97

View File

@ -711,7 +711,9 @@ class FileDownloader(object):
return return
try: try:
os.makedirs(os.path.dirname(filename)) dn = os.path.dirname(filename)
if dn != '' and not os.path.exists(dn):
os.makedirs(dn)
except (OSError, IOError), err: except (OSError, IOError), err:
self.trouble(u'ERROR: unable to create directories: %s' % str(err)) self.trouble(u'ERROR: unable to create directories: %s' % str(err))
return return