Blenders installs where the scripts dir was not writable could not load the console. This should fix it.

This commit is contained in:
Campbell Barton 2007-05-20 07:41:21 +00:00
parent c0dcbacd4b
commit 02893ff5ae

@ -782,8 +782,13 @@ if scriptDir:
if not sys.exists(console_autoexec):
# touch the file
cmdBuffer.append(cmdLine('...console_autoexec.py not found, making new in scripts dir', 1, None))
open(console_autoexec, 'w').close()
try:
open(console_autoexec, 'w').close()
cmdBuffer.append(cmdLine('...console_autoexec.py not found, making new in scripts dir', 1, None))
except:
cmdBuffer.append(cmdLine('...console_autoexec.py could not write, this is ok', 1, None))
scriptDir = None # make sure we only use this for console_autoexec.py
else:
cmdBuffer.append(cmdLine('...Using existing console_autoexec.py in scripts dir', 1, None))