Merge pull request #321 from shinji-s/adhoc_fix

Remove redundant list comprehension.
pull/325/head
multibootusb 6 years ago committed by GitHub
commit d4c171a7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,12 +174,12 @@ def clean_iso_cfg_ext_dir(iso_cfg_ext_dir):
:return:
"""
if os.path.exists(iso_cfg_ext_dir):
filelist = [f for f in os.listdir(iso_cfg_ext_dir)]
for f in filelist:
if os.path.isdir(os.path.join(iso_cfg_ext_dir, f)):
shutil.rmtree(os.path.join(iso_cfg_ext_dir, f))
for f in os.listdir(iso_cfg_ext_dir):
fullpath = os.path.join(iso_cfg_ext_dir, f)
if os.path.isdir(fullpath):
shutil.rmtree(fullpath)
else:
os.remove(os.path.join(iso_cfg_ext_dir, f))
os.remove(fullpath)
else:
log('iso_cfg_ext_dir directory does not exist.')

Loading…
Cancel
Save