From 33733eb2c4fc57a3dd9de33a868b74c4f0eaf0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Fri, 26 Jun 2015 17:52:49 -0500 Subject: [PATCH] Added a fix for gencache on win32com --- src/fixes/__init__.py | 6 +++--- src/fixes/fix_requests_cert_location.py | 9 --------- src/fixes/fix_win32com.py | 7 +++++++ 3 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 src/fixes/fix_requests_cert_location.py create mode 100644 src/fixes/fix_win32com.py diff --git a/src/fixes/__init__.py b/src/fixes/__init__.py index a5dee757..a0546c94 100644 --- a/src/fixes/__init__.py +++ b/src/fixes/__init__.py @@ -2,11 +2,11 @@ """ This module contains some bugfixes for packages used in TWBlue.""" import sys import fix_arrow # A few new locales for Three languages in arrow. -# import fix_requests_cert_location # For a better compilation in Windows. import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython. +import fix_win32com def setup(): fix_arrow.fix() -# if hasattr(sys, "frozen"): -# fix_requests_cert_location.fix() + if hasattr(sys, "frozen"): + fix_win32com.fix() fix_urllib3_warnings.fix() \ No newline at end of file diff --git a/src/fixes/fix_requests_cert_location.py b/src/fixes/fix_requests_cert_location.py deleted file mode 100644 index f06c884c..00000000 --- a/src/fixes/fix_requests_cert_location.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -import paths - -def where(): - return paths.app_path(r"requests\cacert.pem") - -def fix(): - from requests import certs - certs.where = where \ No newline at end of file diff --git a/src/fixes/fix_win32com.py b/src/fixes/fix_win32com.py new file mode 100644 index 00000000..04990eea --- /dev/null +++ b/src/fixes/fix_win32com.py @@ -0,0 +1,7 @@ +import win32com.client + + +def fix(): + if win32com.client.gencache.is_readonly == True: + win32com.client.gencache.is_readonly = False + win32com.client.gencache.Rebuild() \ No newline at end of file