|
[Py2exe-checkins] py2exe/sandbox/py2exe build_exe.py,1.47,1.48
From: <theller@us...> - 2003-12-29 10:20
|
Update of /cvsroot/py2exe/py2exe/sandbox/py2exe
In directory sc8-pr-cvs1:/tmp/cvs-serv23193
Modified Files:
build_exe.py
Log Message:
Force copying of the 'template' file - we are modifying it afterwards,
so we can't use the timestamp to see if this is needed or not.
And make sure it isn't readonly.
Index: build_exe.py
===================================================================
RCS file: /cvsroot/py2exe/py2exe/sandbox/py2exe/build_exe.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** build_exe.py 13 Nov 2003 21:00:24 -0000 1.47
--- build_exe.py 29 Dec 2003 10:20:22 -0000 1.48
***************
*** 6,10 ****
from distutils.spawn import spawn
from distutils.errors import *
! import sys, os, imp, types
import marshal
import zipfile
--- 6,10 ----
from distutils.spawn import spawn
from distutils.errors import *
! import sys, os, imp, types, stat
import marshal
import zipfile
***************
*** 479,483 ****
--- 479,497 ----
src = os.path.join(os.path.dirname(__file__), template)
+ # We want to force the creation of this file, as otherwise distutils
+ # will see the earlier time of our 'template' file versus the later
+ # time of our modified template file, and consider our old file OK.
+ old_force = self.force
+ self.force = True
self.copy_file(src, exe_path)
+ self.force = old_force
+
+ # Make sure the file is writeable...
+ os.chmod(exe_path, stat.S_IREAD | stat.S_IWRITE)
+ try:
+ f = open(exe_path, "a+b")
+ f.close()
+ except IOError, why:
+ print "WARNING: File %s could not be opened - %s" % (pathname, why)
# We create a list of code objects, and write it as a marshaled
|
| Thread | Author | Date |
|---|---|---|
| [Py2exe-checkins] py2exe/sandbox/py2exe build_exe.py,1.47,1.48 | <theller@us...> |