summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Massaru Iha <vitor@massaru.org>2017-10-08 15:28:32 -0300
committerDamien George <damien.p.george@gmail.com>2017-10-11 11:37:01 +1100
commit1b7d6a795149588eb44c1b33dd7c34fe6669460a (patch)
tree74830962af4e958da44535534ed37dfc5b24abd3
parentb1457db002a7205727f49c48f56ed270e2568d6a (diff)
esp8266/modules/webrepl_setup: Add info about allowed password length.
This patch also makes the code more concise by combining the checks for the password length.
-rw-r--r--ports/esp8266/modules/webrepl_setup.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ports/esp8266/modules/webrepl_setup.py b/ports/esp8266/modules/webrepl_setup.py
index d91600e6e..5288c49c0 100644
--- a/ports/esp8266/modules/webrepl_setup.py
+++ b/ports/esp8266/modules/webrepl_setup.py
@@ -17,12 +17,9 @@ def getpass(prompt):
def input_pass():
while 1:
- passwd1 = getpass("New password: ")
- if len(passwd1) < 4:
- print("Password too short")
- continue
- elif len(passwd1) > 9:
- print("Password too long")
+ passwd1 = getpass("New password (4-9 chars): ")
+ if len(passwd1) < 4 or len(passwd1) > 9:
+ print("Invalid password length")
continue
passwd2 = getpass("Confirm password: ")
if passwd1 == passwd2: