only create dirs if they dont exist - fixes crash

This commit is contained in:
Marcos Pinto 2008-07-13 20:16:50 +00:00
parent 4f50438b61
commit ceaa06d1ad
1 changed files with 4 additions and 2 deletions

View File

@ -61,10 +61,12 @@ def start_ui():
if deluge.common.windows_check():
if options.config:
os.makedirs(options.config)
if not os.path.exists(options.config):
os.makedirs(options.config)
logfile = os.path.join(options.config, "deluge.log")
else:
os.makedirs(deluge.common.get_default_config_dir())
if not os.path.exists(deluge.common.get_default_config_dir()):
os.makedirs(deluge.common.get_default_config_dir())
logfile = deluge.common.get_default_config_dir("deluge.log")
sys.stdout = open(logfile, "wb")