X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3798e298a412c4bc05b5aa83507b3c251dd36233..6a52ea5cb81dcd07c286d34b80945534780fe05f:/wxPython/distrib/build_renamers.py diff --git a/wxPython/distrib/build_renamers.py b/wxPython/distrib/build_renamers.py index e5f16ed19c..e99acb3a8f 100755 --- a/wxPython/distrib/build_renamers.py +++ b/wxPython/distrib/build_renamers.py @@ -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: @@ -211,7 +213,7 @@ def processXML(xmlfile, modname, swigFile, pyFile): addWX = True - if doRename: + if doRename and name: old = new = name if old.startswith('wx') and not old.startswith('wxEVT_'): # remove all wx prefixes except wxEVT_ and write a %rename directive for it