Skip to content

Commit d92d20a

Browse files
committed
Support Click 8.2+
Click 8.2 and above will now force an abort if a confirmation prompt isn't answered, rather than raising the CLIAbort that is expected. Catch this exception so that our own exceptions are raised.
1 parent 85255be commit d92d20a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SoftLayer/CLI/formatting.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ def no_going_back(confirmation):
260260

261261
prompt = f"This action cannot be undone! Type '{confirmation}' or press Enter to abort"
262262

263-
ans = click.prompt(prompt, default='', show_default=False)
263+
try:
264+
ans = click.prompt(prompt, default='', show_default=False)
265+
except click.exceptions.Abort:
266+
return False
264267
if ans.lower() == str(confirmation).lower():
265268
return True
266269

0 commit comments

Comments
 (0)