RuntimeError was caught to catch set modification during iteration.
Now I want to catch all system-related exception.
try:
unmount(device, "")
logging.debug('Unmounted %s' % device)
try:
unmount(device, "")
logging.debug('Unmounted %s' % device)
logging.debug('RuntimeError while umount %s, ignoring' % device)
for tmppath in TMPFILES.copy():
logging.debug('RuntimeError while umount %s, ignoring' % device)
for tmppath in TMPFILES.copy():
os.unlink(tmppath)
logging.debug('temporary file %s deleted' % tmppath)
unregister_tmpfile(tmppath)
os.unlink(tmppath)
logging.debug('temporary file %s deleted' % tmppath)
unregister_tmpfile(tmppath)
msg = 'RuntimeError while removing temporary %s, ignoring'
logging.debug(msg % tmppath)
msg = 'RuntimeError while removing temporary %s, ignoring'
logging.debug(msg % tmppath)