From 268a2dd818ed4a539845609a5c0370101548c4e4 Mon Sep 17 00:00:00 2001 From: sinscary Date: Wed, 26 Feb 2020 14:14:34 +0530 Subject: [PATCH] Revert "Raise error if --user and --target arguments are used together" This reverts commit b6d775d98837a5eaf2cba73a719821c89a71fc8f. --- news/7249.feature | 1 - src/pip/_internal/cli/main_parser.py | 19 +++++-------------- 2 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 news/7249.feature diff --git a/news/7249.feature b/news/7249.feature deleted file mode 100644 index 4548aa006e2..00000000000 --- a/news/7249.feature +++ /dev/null @@ -1 +0,0 @@ -Raise error if --user and --target are used together in command diff --git a/src/pip/_internal/cli/main_parser.py b/src/pip/_internal/cli/main_parser.py index 9fd3af49e9b..4871956c9de 100644 --- a/src/pip/_internal/cli/main_parser.py +++ b/src/pip/_internal/cli/main_parser.py @@ -83,17 +83,6 @@ def parse_command(args): # the subcommand name cmd_name = args_else[0] - validate_command_args(cmd_name, args_else) - - # all the args without the subcommand - cmd_args = args[:] - cmd_args.remove(cmd_name) - - return cmd_name, cmd_args - - -def validate_command_args(cmd_name, args_else): - # type: (str, List[str]) -> None if cmd_name not in commands_dict: guess = get_similar_commands(cmd_name) @@ -103,6 +92,8 @@ def validate_command_args(cmd_name, args_else): raise CommandError(' - '.join(msg)) - if set(['--user', '--target']).issubset(set(args_else)): - error_msg = '--user and --target cant not be used together.' - raise CommandError(error_msg) + # all the args without the subcommand + cmd_args = args[:] + cmd_args.remove(cmd_name) + + return cmd_name, cmd_args