Commit a389cc76 authored by jvoisin's avatar jvoisin

Fix a stacktrace in ./mat2 when the file can't be cleaned

parent 4034cf9a
Pipeline #28478 passed with stages
in 4 minutes and 19 seconds
......@@ -137,9 +137,10 @@ def clean_meta(filename: str, is_lightweight: bool, inplace: bool, sandbox: bool
try:
logging.debug('Cleaning %s…', filename)
ret = p.remove_all()
shutil.copymode(filename, p.output_filename)
if inplace is True:
os.rename(p.output_filename, filename)
if ret is True:
shutil.copymode(filename, p.output_filename)
if inplace is True:
os.rename(p.output_filename, filename)
return ret
except RuntimeError as e:
print("[-] %s can't be cleaned: %s" % (filename, e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment