Fix a stacktrace in ./mat2 when the file can't be cleaned
This commit is contained in:
parent
4034cf9a1a
commit
a389cc760a
7
mat2
7
mat2
@ -137,9 +137,10 @@ def clean_meta(filename: str, is_lightweight: bool, inplace: bool, sandbox: bool
|
|||||||
try:
|
try:
|
||||||
logging.debug('Cleaning %s…', filename)
|
logging.debug('Cleaning %s…', filename)
|
||||||
ret = p.remove_all()
|
ret = p.remove_all()
|
||||||
shutil.copymode(filename, p.output_filename)
|
if ret is True:
|
||||||
if inplace is True:
|
shutil.copymode(filename, p.output_filename)
|
||||||
os.rename(p.output_filename, filename)
|
if inplace is True:
|
||||||
|
os.rename(p.output_filename, filename)
|
||||||
return ret
|
return ret
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
print("[-] %s can't be cleaned: %s" % (filename, e))
|
print("[-] %s can't be cleaned: %s" % (filename, e))
|
||||||
|
Loading…
Reference in New Issue
Block a user