Skip to content

Commit 5bd528c

Browse files
author
rocky
committed
Future code to delete bytecode file when matches
1 parent 78e3960 commit 5bd528c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_writing_pyc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def load_meta_and_code_from_filename(path: str):
174174

175175

176176
def main(argv: List[str]) -> int:
177+
178+
unlink_on_success = False
177179
# parser = argparse.ArgumentParser(
178180
# description="Load a .pyc with xdis, rewrite it to a temporary file, and compare."
179181
# )
@@ -262,6 +264,8 @@ def main(argv: List[str]) -> int:
262264
print("Rewritten file:", tf_name)
263265
print("Raw-bytes identical:", same_bytes)
264266
if same_bytes:
267+
if unlink_on_success:
268+
os.unlink(tf_name)
265269
return 0
266270

267271
compare_showing_error(orig_path, tf_name)

0 commit comments

Comments
 (0)