Commit e8b404b4 by Jim Stichnoth

Subzero: Make python clean up after itself by removing its /tmp subdir.

BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/551723003
parent 0fb613f8
#!/usr/bin/env python2
import argparse
import errno
import os
import shutil
import tempfile
from utils import shellcmd
from utils import FindBaseNaCl
......@@ -21,6 +23,7 @@ if __name__ == '__main__':
nacl_root + '/toolchain/linux_x86/pnacl_newlib/bin' + os.pathsep +
os.pathsep + os.environ['PATH'])
try:
tempdir = tempfile.mkdtemp()
for cname in args.cfile:
......@@ -36,3 +39,9 @@ if __name__ == '__main__':
' -verify-pnaclabi-module -verify-pnaclabi-functions') +
' -pnaclabi-allow-debug-metadata'
' {0} -S -o {1}'.format(llname, pnaclname))
finally:
try:
shutil.rmtree(tempdir)
except OSError as exc:
if exc.errno != errno.ENOENT: # ENOENT - no such file or directory
raise # re-raise exception
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment