Skip to content

Commit 61305d3

Browse files
committed
Fixes #15633
Added a guard to alternative_password_generator to raise ValueError when the required characters exceed the requested password length.
1 parent 6e03a48 commit 61305d3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎other/password.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def alternative_password_generator(chars_incl: str, i: int) -> str:
2929
# Password Generator = full boot with random_number, random_letters, and
3030
# random_character FUNCTIONS
3131
# Put your code here...
32+
if i < len(chars_incl):
33+
raise ValueError("Required characters exceed the requested password length")
3234
i -= len(chars_incl)
3335
quotient = i // 3
3436
remainder = i % 3

0 commit comments

Comments
 (0)