1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

Redirect error log file on Windows.

This commit is contained in:
Jonathan Harris 2015-06-03 15:12:16 +01:00
parent be8fe50e49
commit 41958801af

@ -1,6 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from sys import platform
from os import mkdir
from os.path import expanduser, isdir, join
@ -16,7 +17,7 @@ import companion
import bpc
import eddn
import prefs
from config import applongname, config
from config import appname, applongname, config
class AppWindow:
@ -180,6 +181,11 @@ class AppWindow:
if __name__ == "__main__":
if platform=='win32' and getattr(sys, 'frozen', False):
# By deault py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')
# Run the app
root = tk.Tk()
app = AppWindow(root)