mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Fixed com cache error
This commit is contained in:
parent
adf062f654
commit
0307c0abe3
@ -2,15 +2,25 @@ from pywintypes import com_error
|
|||||||
import win32com
|
import win32com
|
||||||
import paths
|
import paths
|
||||||
win32com.__gen_path__=paths.data_path("com_cache")
|
win32com.__gen_path__=paths.data_path("com_cache")
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
sys.path.append(os.path.join(win32com.__gen_path__, "."))
|
||||||
from win32com.client import gencache
|
from win32com.client import gencache
|
||||||
|
fixed=False
|
||||||
|
|
||||||
def prepare_gencache():
|
def prepare_gencache():
|
||||||
gencache.is_readonly = False
|
gencache.is_readonly = False
|
||||||
gencache.GetGeneratePath()
|
gencache.GetGeneratePath()
|
||||||
|
|
||||||
|
def patched_getmodule(modname):
|
||||||
|
mod=__import__(modname)
|
||||||
|
return sys.modules[modname]
|
||||||
|
|
||||||
def load_com(*names):
|
def load_com(*names):
|
||||||
|
global fixed
|
||||||
|
if fixed==False:
|
||||||
|
gencache._GetModule=patched_getmodule
|
||||||
|
fixed=True
|
||||||
result = None
|
result = None
|
||||||
for name in names:
|
for name in names:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user