Save error log to tempdir on OSX

This commit is contained in:
Jonathan Harris committed 2017-01-27 13:32:51 +00:00
1 parent a247ace6c8
commit ca7d0f9c4c
1 file changed
+3 -2
+3 -2
View File
@@ -28,8 +28,9 @@ if __debug__:
signal.signal(signal.SIGTERM, lambda sig, frame: pdb.Pdb().set_trace(frame))
from config import appname, applongname, config
if platform == 'win32' and getattr(sys, 'frozen', False):
chdir(dirname(sys.path[0]))
if getattr(sys, 'frozen', False):
if platform == 'win32':
chdir(dirname(sys.path[0]))
# By default py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 0) # unbuffered