From b2b4887f7616a7316f22521479a600a15668339c Mon Sep 17 00:00:00 2001 From: Lukas Prokop Date: Wed, 19 Feb 2014 23:47:38 +0100 Subject: [PATCH 1/1] Create copies of set before iteration --- grml2usb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grml2usb b/grml2usb index 93b1d11..94f73ed 100755 --- a/grml2usb +++ b/grml2usb @@ -170,14 +170,14 @@ def cleanup(): 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: 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 -- 2.1.4