Skip to content

Commit 1b7d6a7

Browse files
ihadpgeorge
authored andcommitted
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.
1 parent b1457db commit 1b7d6a7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ports/esp8266/modules/webrepl_setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ def getpass(prompt):
1717

1818
def input_pass():
1919
while 1:
20-
passwd1 = getpass("New password: ")
21-
if len(passwd1) < 4:
22-
print("Password too short")
23-
continue
24-
elif len(passwd1) > 9:
25-
print("Password too long")
20+
passwd1 = getpass("New password (4-9 chars): ")
21+
if len(passwd1) < 4 or len(passwd1) > 9:
22+
print("Invalid password length")
2623
continue
2724
passwd2 = getpass("Confirm password: ")
2825
if passwd1 == passwd2:

0 commit comments

Comments
 (0)