os.remove might throw an exception (of type OSError), if given file
doesn't exist. Catch the exception, and ignore it iff errno is
ENOENT. Rethrow the exception, if errno is not ENOENT.
Details
Diff Detail
Event Timeline
scripts/Python/buildSwigPython.py | ||
---|---|---|
698–699 | Do we not have the same issue here? |
scripts/Python/buildSwigPython.py | ||
---|---|---|
698–699 | Presumably, yes. I wasn't trying with LLDB_DISABLE_PYTHON, but with CMake generated Xcode project on Darwin, and region below failed. I didn't examine all instances of os.remove, I guess I should have. How about: def removeignoreenoent(filename): try: os.remove(filename) except OSError as e: import errno if e.errno != errno.ENOENT: raise pass and call this function instead of os.remove. We might use a better/shorter name; any suggestions? |
scripts/Python/buildSwigPython.py | ||
---|---|---|
435 | Please add underscores between the words, to be consistent with the naming convention used elsewhere in this function. |
Looks fine with a couple of minor comments.
scripts/Python/buildSwigPython.py | ||
---|---|---|
431–433 | This comment seems overly verbose -- it's clear from reading the function that this is what happens. What about something succinct like "Remove a file, ignoring error if it does not exist." | |
602 | random whitespace change |
This comment seems overly verbose -- it's clear from reading the function that this is what happens. What about something succinct like "Remove a file, ignoring error if it does not exist."