diff options
| -rwxr-xr-x | mat2 | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -137,9 +137,10 @@ def clean_meta(filename: str, is_lightweight: bool, inplace: bool, sandbox: bool | |||
| 137 | try: | 137 | try: |
| 138 | logging.debug('Cleaning %s…', filename) | 138 | logging.debug('Cleaning %s…', filename) |
| 139 | ret = p.remove_all() | 139 | ret = p.remove_all() |
| 140 | shutil.copymode(filename, p.output_filename) | 140 | if ret is True: |
| 141 | if inplace is True: | 141 | shutil.copymode(filename, p.output_filename) |
| 142 | os.rename(p.output_filename, filename) | 142 | if inplace is True: |
| 143 | os.rename(p.output_filename, filename) | ||
| 143 | return ret | 144 | return ret |
| 144 | except RuntimeError as e: | 145 | except RuntimeError as e: |
| 145 | print("[-] %s can't be cleaned: %s" % (filename, e)) | 146 | print("[-] %s can't be cleaned: %s" % (filename, e)) |
