From 81ddf7e1d28c538083742ead1aaea121a8256d28 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 18 Oct 2019 12:43:28 -0400 Subject: [PATCH] use an assert to check password --- torba/torba/client/wallet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/torba/torba/client/wallet.py b/torba/torba/client/wallet.py index d546cd33f..acc1d01b4 100644 --- a/torba/torba/client/wallet.py +++ b/torba/torba/client/wallet.py @@ -238,8 +238,7 @@ class Wallet: def encrypt(self, password): assert not self.is_locked, "Cannot re-encrypt a locked wallet, unlock first." - if not password: - raise ValueError("Cannot encrypt with blank password.") + assert password, "Cannot encrypt with blank password." self.encryption_password = password self.preferences[ENCRYPT_ON_DISK] = True self.save()