X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=cdbb3e83fffcca1473626a9a8599afa09468c39a;hp=da6bfe07c0f10bf502c94a647559187fa1f6906f;hb=d33e012e1a3388b32fe53e7faf1ac45a663917af;hpb=2700dd6bfe8df1162eb4f75d5d48b91d3375e8f6 diff --git a/grml2usb b/grml2usb index da6bfe0..cdbb3e8 100755 --- a/grml2usb +++ b/grml2usb @@ -170,13 +170,14 @@ def cleanup(): proc = subprocess.Popen(["sync"]) proc.wait() - for device in MOUNTED: + for device in MOUNTED.copy(): try: unmount(device, "") - except RuntimeError: + logging.debug('Unmounted %s' % device) + 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 @@ -188,7 +189,7 @@ def cleanup(): 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)