Skip to content

Commit 70b3bac

Browse files
committed
Validate configuration input from the user
1 parent 66f1b17 commit 70b3bac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pip/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ def parseopts(args):
215215
except ConfigurationError:
216216
autocorrect_delay = None
217217

218+
try:
219+
autocorrect_delay = float(autocorrect_delay)
220+
except ValueError:
221+
raise ConfigurationError(
222+
"autocorrect needs to be a numerical value"
223+
)
224+
218225
guess, score = get_closest_command(cmd_name)
219226

220227
# Decide what message has to be shown to user

0 commit comments

Comments
 (0)