[pywin32-checkins] pywin32/com/win32com/client gencache.py,1.29,1.30 makepy.py,1.18,1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-01-25 09:51:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27628 Modified Files: gencache.py makepy.py Log Message: Fix [ 1085454 ] Py 2.4 + MS Excel COM --> crash Avoid crashes on Python 2.4 by defaulting to bForDemand=True - ie, each typelib actually creates a "skeleton" Python package, and populates the package as each interface is requested. Cause of the underling crash is that the generated .py causes an overflow as the byte-code is generated - something in 2.4 bloated the byte-code for these modules. Index: makepy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/makepy.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** makepy.py 27 Oct 2002 10:19:40 -0000 1.18 --- makepy.py 25 Jan 2005 09:51:23 -0000 1.19 *************** *** 51,55 **** from win32com.client import NeedUnicodeConversions ! bForDemandDefault = 0 # Default value of bForDemand - toggle this to change the world - see also gencache.py error = "makepy.error" --- 51,60 ---- from win32com.client import NeedUnicodeConversions ! # Python 2.4 will crash on a huge typelib (eg, Excel) if bForDemand is False. ! # That looks like a good excuse to try and move to that more efficient ! # (for large typelibs) scheme. ! # Default value of bForDemand - override this (also in gencache.py) to ! # change the world. ! bForDemandDefault = sys.hexversion >= 0x2040000 error = "makepy.error" *************** *** 180,190 **** sys.exit(1) ! def GenerateFromTypeLibSpec(typelibInfo, file = None, verboseLevel = None, progressInstance = None, bUnicodeToString=NeedUnicodeConversions, bQuiet = None, bGUIProgress = None, bForDemand = bForDemandDefault, bBuildHidden = 1): ! if bQuiet is not None or bGUIProgress is not None: ! print "Please dont use the bQuiet or bGUIProgress params" ! print "use the 'verboseLevel', and 'progressClass' params" if verboseLevel is None: ! verboseLevel = 0 # By default, we use a gui, and no verbose level! ! if bForDemand and file is not None: raise RuntimeError, "You can only perform a demand-build when the output goes to the gen_py directory" --- 185,191 ---- sys.exit(1) ! def GenerateFromTypeLibSpec(typelibInfo, file = None, verboseLevel = None, progressInstance = None, bUnicodeToString=NeedUnicodeConversions, bForDemand = bForDemandDefault, bBuildHidden = 1): if verboseLevel is None: ! verboseLevel = 0 if bForDemand and file is not None: raise RuntimeError, "You can only perform a demand-build when the output goes to the gen_py directory" Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** gencache.py 3 May 2004 01:55:25 -0000 1.29 --- gencache.py 25 Jan 2005 09:51:23 -0000 1.30 *************** *** 29,33 **** import operator ! bForDemandDefault = 0 # Default value of bForDemand - toggle this to change the world - see also makepy.py # The global dictionary --- 29,38 ---- import operator ! # Python 2.4 will crash on a huge typelib (eg, Excel) if bForDemand is False. ! # That looks like a good excuse to try and move to that more efficient ! # (for large typelibs) scheme. ! # Default value of bForDemand - override this (also in makepy.py) to ! # change the world. ! bForDemandDefault = sys.hexversion >= 0x2040000 # The global dictionary |