fix(whatsapp): remove shadowing shutil import in cmd_whatsapp (#13364)

The re-pair branch had a redundant 'import shutil' inside cmd_whatsapp,
which made shutil a function-local throughout the whole scope. The
earlier 'shutil.which("npm")' call at the dependency-install step then
crashed with UnboundLocalError before control ever reached the local
import.

shutil is already imported at module level (line 48), so the local
import was dead code anyway. Drop it.
This commit is contained in:
Teknium 2026-04-21 00:12:44 -07:00 committed by GitHub
parent 62cbeb6367
commit 9c0fc0b4e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1330,8 +1330,6 @@ def cmd_whatsapp(args):
except (EOFError, KeyboardInterrupt):
response = "n"
if response.lower() in ("y", "yes"):
import shutil
shutil.rmtree(session_dir, ignore_errors=True)
session_dir.mkdir(parents=True, exist_ok=True)
print(" ✓ Session cleared")