proc = subprocess.Popen(["sync"])
proc.wait()
- for device in MOUNTED:
+ for device in MOUNTED.copy():
try:
unmount(device, "")
logging.debug('Unmounted %s' % device)
- except RuntimeError:
+ except StandardError:
logging.debug('RuntimeError while umount %s, ignoring' % device)
- for tmppath in TMPFILES:
+ for tmppath in TMPFILES.copy():
try:
if os.path.isdir(tmppath) and not os.path.islink(tmppath):
# symbolic links to directories are ignored
os.unlink(tmppath)
logging.debug('temporary file %s deleted' % tmppath)
unregister_tmpfile(tmppath)
- except RuntimeError:
+ except StandardError:
msg = 'RuntimeError while removing temporary %s, ignoring'
logging.debug(msg % tmppath)