diff --git a/src/fixes/__init__.py b/src/fixes/__init__.py deleted file mode 100644 index ebe08f5..0000000 --- a/src/fixes/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -import sys -from . import fix_requests - -#if hasattr(sys, "frozen"): -from . import fix_win32com -from . import fix_libloader - -def setup(): - fix_requests.fix() -# if hasattr(sys, "frozen"): - fix_libloader.fix() - fix_win32com.fix() diff --git a/src/fixes/fix_libloader.py b/src/fixes/fix_libloader.py deleted file mode 100644 index c73fae7..0000000 --- a/src/fixes/fix_libloader.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -import win32com -import paths -win32com.__build_path__=paths.com_path() -import sys -import os -sys.path.append(os.path.join(win32com.__gen_path__, ".")) -from win32com.client import gencache -from pywintypes import com_error -from libloader import com - -fixed=False - -def patched_getmodule(modname): - mod=__import__(modname) - return sys.modules[modname] - -def load_com(*names): - global fixed - if fixed==False: - gencache._GetModule=patched_getmodule - com.prepare_gencache() - fixed=True - result = None - for name in names: - try: - result = gencache.EnsureDispatch(name) - break - except com_error: - continue - if result is None: - raise com_error("Unable to load any of the provided com objects.") - return result - -def fix(): - com.load_com = load_com diff --git a/src/fixes/fix_requests.py b/src/fixes/fix_requests.py deleted file mode 100644 index 2925ef2..0000000 --- a/src/fixes/fix_requests.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -import requests -import paths -import os -import logging -log = logging.getLogger("fixes.fix_requests") - -def fix(): - log.debug("Applying fix for requests...") - os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(paths.app_path(), "cacert.pem")#.encode(paths.fsencoding) -# log.debug("Changed CA path to %s" % (os.environ["REQUESTS_CA_BUNDLE"]))#.decode(paths.fsencoding))) diff --git a/src/fixes/fix_win32com.py b/src/fixes/fix_win32com.py deleted file mode 100644 index bce0611..0000000 --- a/src/fixes/fix_win32com.py +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import unicode_literals -import win32com.client -def fix(): - if win32com.client.gencache.is_readonly == True: - win32com.client.gencache.is_readonly = False - win32com.client.gencache.Rebuild()