Skip to content

Commit 30267f9

Browse files
authored
Merge pull request #39 from kitcambridge/kit/vapid-helper-fixes
Minor fixes to the `vapid` helper
2 parents 01075d6 + acbc970 commit 30267f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/py_vapid/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def main():
3333
print("No private_key.pem file found.")
3434
answer = None
3535
while answer not in ['y', 'n']:
36-
answer = input("Do you want me to create one for you? (Y/n)")
36+
answer = raw_input("Do you want me to create one for you? (Y/n)")
3737
if not answer:
3838
answer = 'y'
3939
answer = answer.lower()[0]
4040
if answer == 'n':
4141
print("Sorry, can't do much for you then.")
42-
exit
42+
exit(1)
4343
print("Generating private_key.pem")
4444
Vapid().save_key('private_key.pem')
4545
vapid = Vapid.from_file('private_key.pem')
@@ -49,13 +49,13 @@ def main():
4949
"the developer dashboard.")
5050
answer = None
5151
while answer not in ['y', 'n']:
52-
answer = input("Do you want me to create one for you? (Y/n)")
52+
answer = raw_input("Do you want me to create one for you? (Y/n)")
5353
if not answer:
5454
answer = 'y'
5555
answer = answer.lower()[0]
5656
if answer == 'n':
5757
print("Exiting...")
58-
exit
58+
exit(0)
5959
print("Generating public_key.pem")
6060
vapid.save_public_key('public_key.pem')
6161
claim_file = args.sign
@@ -86,7 +86,7 @@ def main():
8686
8787
{"sub": "mailto:[email protected]"}
8888
""")
89-
exit
89+
exit(1)
9090
try:
9191
claims = json.loads(open(claim_file).read())
9292
result.update(vapid.sign(claims))

0 commit comments

Comments
 (0)