mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
py2exe is not able to handle win32com.shell
Changes: - setup.py: help py2exe finding the shell module in win32com.shell
This commit is contained in:
parent
9f6716ae98
commit
d90591c00e
15
setup.py
15
setup.py
@ -6,6 +6,7 @@
|
|||||||
# './setup.py --help' for more options
|
# './setup.py --help' for more options
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
|
import sys
|
||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
from distutils.command.install_data import install_data
|
from distutils.command.install_data import install_data
|
||||||
|
|
||||||
@ -15,6 +16,20 @@ import mercurial.version
|
|||||||
try:
|
try:
|
||||||
import py2exe
|
import py2exe
|
||||||
|
|
||||||
|
# Help py2exe to find win32com.shell
|
||||||
|
try:
|
||||||
|
import modulefinder
|
||||||
|
import win32com
|
||||||
|
for p in win32com.__path__[1:]: # Take the path to win32comext
|
||||||
|
modulefinder.AddPackagePath("win32com", p)
|
||||||
|
pn = "win32com.shell"
|
||||||
|
__import__(pn)
|
||||||
|
m = sys.modules[pn]
|
||||||
|
for p in m.__path__[1:]:
|
||||||
|
modulefinder.AddPackagePath(pn, p)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Due to the use of demandload py2exe is not finding the modules.
|
# Due to the use of demandload py2exe is not finding the modules.
|
||||||
# packagescan.getmodules creates a list of modules included in
|
# packagescan.getmodules creates a list of modules included in
|
||||||
# the mercurial package plus depdent modules.
|
# the mercurial package plus depdent modules.
|
||||||
|
Loading…
Reference in New Issue
Block a user