From cf341047c16e7097371d6ccd67d02fde322d4204 Mon Sep 17 00:00:00 2001 From: tmpz23 <28760271+tmpz23@users.noreply.github.com> Date: Sun, 28 Nov 2021 07:45:21 +0100 Subject: [PATCH] Update pzztool.py --- pzztool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pzztool.py b/pzztool.py index 7577b9d..253e4ba 100644 --- a/pzztool.py +++ b/pzztool.py @@ -391,7 +391,8 @@ if __name__ == '__main__': # Si on a pas la bonne extension on ne compresse pas le fichier if not args.disable_ignore and Path(filename).suffix == ".pzzp": logging.warning(f"Ignored - {filename} - bad extension - musn't be a pzzp") - shutil.copy(p_input / filename, p_output / filename) + if p_input != p_output: + shutil.copy(p_input / filename, p_output / filename) continue logging.info(f"Compressing {filename}") (p_output / (Path(filename).stem + ".pzzp")).write_bytes(pzz_compress((p_input / filename).read_bytes())) @@ -404,7 +405,8 @@ if __name__ == '__main__': for filename in listdir(p_input): if not args.disable_ignore and Path(filename).suffix != ".pzzp": logging.warning(f"Ignored - {filename} - bad extension - must be a pzzp") - shutil.copy(p_input / filename, p_output / filename) + if p_input != p_output: + shutil.copy(p_input / filename, p_output / filename) continue logging.info(f"Decompressing {filename}") uncompressed_content = pzz_decompress((p_input / filename).read_bytes())