Ensure that the .py file exists before deciding to skip running sip

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-06-26 18:25:52 +00:00
parent b55d1879d3
commit 0fbc3d4f5d

View File

@@ -702,17 +702,17 @@ def sip(options, args):
src_name = src_name.replace('\\', '/')
base = os.path.basename(os.path.splitext(src_name)[0])
sbf = posixjoin(cfg.SIPOUT, base) + '.sbf'
pycode = base[1:] # remove the leading _
pycode = posixjoin(cfg.PKGDIR, pycode) + '.py'
# Check if any of the included files are newer than the .sbf file
# produced by the previous run of sip. If not then we don't need to
# run sip again.
etg = loadETG(posixjoin('etg', base + '.py'))
sipFiles = getSipFiles(etg.INCLUDES)
if not newer_group(sipFiles, sbf):
if not newer_group(sipFiles, sbf) and os.path.exists(pycode):
continue
pycode = base[1:] # remove the leading _
pycode = posixjoin(cfg.PKGDIR, pycode) + '.py'
pycode = '-X pycode'+base+':'+pycode
sip = getSipCmd()
cmd = '%s %s -c %s -b %s %s %s' % \