1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Code cleanup

This commit is contained in:
Paweł Jastrzębski
2017-11-02 10:28:43 +01:00
parent 7c0b78350d
commit a695a4c151
8 changed files with 109 additions and 132 deletions

20
kcc.py
View File

@@ -34,24 +34,6 @@ if sys.platform.startswith('darwin'):
else:
os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/osx/:' + os.environ['PATH']
elif sys.platform.startswith('win'):
'''
import multiprocessing.popen_spawn_win32 as forking
class _Popen(forking.Popen):
def __init__(self, *args, **kw):
if hasattr(sys, 'frozen'):
# noinspection PyUnresolvedReferences,PyProtectedMember
os.putenv('_MEIPASS2', sys._MEIPASS)
try:
super(_Popen, self).__init__(*args, **kw)
finally:
if hasattr(sys, 'frozen'):
if hasattr(os, 'unsetenv'):
os.unsetenv('_MEIPASS2')
else:
os.putenv('_MEIPASS2', '')
forking.Popen = _Popen
'''
if getattr(sys, 'frozen', False):
os.chdir(os.path.dirname(os.path.abspath(sys.executable)))
else:
@@ -61,7 +43,7 @@ elif sys.platform.startswith('win'):
if getattr(sys, 'frozen', False):
try:
import kindlecomicconverter.sentry
except:
except ImportError:
pass
from multiprocessing import freeze_support