Fix wasi.py build after adding the clean subcommand. ({GH-114447)

This commit is contained in:
Brett Cannon 2024-01-22 10:28:57 -08:00 • committed by GitHub
parent 7fc51c3f6b
commit 5cd9c6b1fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,7 +68,8 @@ def subdir(working_dir, *, clean_ok=False):
terminal_width = 80
print("⎯" * terminal_width)
print("📁", working_dir)
if clean_ok and context.clean and working_dir.exists():
if (clean_ok and getattr(context, "clean", False) and
working_dir.exists()):
print(f"🚮 Deleting directory (--clean)...")
shutil.rmtree(working_dir)