Added a succint comment, and removed whitespace change.
http://reviews.llvm.org/D6362
Files:
scripts/Python/buildSwigPython.py
Index: scripts/Python/buildSwigPython.py
===================================================================
--- scripts/Python/buildSwigPython.py
+++ scripts/Python/buildSwigPython.py
@@ -427,6 +427,18 @@
return (bOk, strConfigBldDir, strErrMsg);
+"""
+Removes given file, ignoring error if it doesn't exist.
+"""
+def remove_ignore_enoent(filename):
+ try:
+ os.remove( strSwigOutputFile );
+ except OSError as e:
+ import errno
+ if e.errno != errno.ENOENT:
+ raise
+ pass
+
#++---------------------------------------------------------------------------
# Details: Do a SWIG code rebuild. Any number returned by SWIG which is not
# zero is treated as an error. The generate dependencies flag decides
@@ -683,7 +695,7 @@
# iOS be sure to set LLDB_DISABLE_PYTHON to 1.
if (strEnvVarLLDBDisablePython != None) and \
(strEnvVarLLDBDisablePython == "1"):
- os.remove( strSwigOutputFile );
+ remove_ignore_enoent( strSwigOutputFile )
open( strSwigOutputFile, 'w' ).close(); # Touch the file
if bDebug:
strMsg = strMsgLldbDisablePython;
@@ -696,7 +708,7 @@
None );
if (strEnvVarGccPreprocessDefs != None) or \
(strEnvVarLLDBDisablePython != None):
- os.remove( strSwigOutputFile );
+ remove_ignore_enoent( strSwigOutputFile )
open( strSwigOutputFile, 'w' ).close(); # Touch the file
if bDebug:
strMsg = strMsgLldbDisableGccEnv;
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits