check for existance of output files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-01-14 01:50:35 +00:00
parent 14dfb3d258
commit 6c72a02688

View File

@ -122,7 +122,9 @@ def main(args):
# blow away the old one if they are different.
for dest, temp in [(swigDest, swigDestTemp),
(pyDest, pyDestTemp)]:
if open(dest).read() != open(temp).read():
if not os.path.exists(dest):
os.rename(temp, dest)
elif open(dest).read() != open(temp).read():
os.unlink(dest)
os.rename(temp, dest)
else: