Good point to use atexit to ensure all files are properly removed.

Thanks Thimo.

Thimo Kraemer píše v Ne 03. 06. 2012 v 23:04 +0200:
> Hi,
> 
> I use the following fix:
> 
> import os, sys, tempfile, atexit, shutil
> #supportdir = os.path.join(sys.path[0], 'support')
> supportdir = tempfile.mkdtemp()
> atexit.register(shutil.rmtree, supportdir, True)
> genpydir = os.path.join(supportdir, 'gen_py')
> initmod = os.path.join(genpydir, '__init__.py')
> if not os.path.exists(genpydir):
>      os.makedirs(genpydir)
> if not os.path.exists(initmod):
>      open(initmod, 'w')
> import win32com
> win32com.__gen_path__ = genpydir
> win32com.__path__.insert(0, supportdir)
> # for older Pythons
> import copy_reg 

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to