Skip to content

Commit

Permalink
Create copies of set before iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterluk committed Feb 19, 2014
1 parent 1d3c9da commit b2b4887
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grml2usb
Expand Up @@ -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
Expand Down

0 comments on commit b2b4887

Please sign in to comment.