Index: tools/utils.py |
diff --git a/tools/utils.py b/tools/utils.py |
index 0917aa4f43a30a688dbdf9688e6aa9f177965a62..f65d9e6c273f41baf0aacc2bbe37afe53b7d17de 100644 |
--- a/tools/utils.py |
+++ b/tools/utils.py |
@@ -197,10 +197,19 @@ def Daemonize(): |
def PrintError(str): |
+ """Writes and flushes a string to stderr.""" |
sys.stderr.write(str) |
sys.stderr.write('\n') |
+def CheckedUnlink(name): |
+ """Unlink a file without throwing an exception.""" |
+ try: |
+ os.unlink(name) |
+ except OSError, e: |
+ PrintError("os.unlink() " + str(e)) |
+ |
+ |
def Main(argv): |
print "GuessOS() -> ", GuessOS() |
print "GuessArchitecture() -> ", GuessArchitecture() |