Skip to content

Commit 073666e

Browse files
committed
Make this an error rather than a warning
1 parent 6aa4d48 commit 073666e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

news/12067.bugfix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Warn if the ``--python`` option is specified after the subcommand name.
1+
Fail with an error if the ``--python`` option is specified after the subcommand name.

src/pip/_internal/cli/base_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def _main(self, args: List[str]) -> int:
138138
# subprocess, which has the _PIP_RUNNING_IN_SUBPROCESS environment
139139
# variable set.
140140
if options.python and "_PIP_RUNNING_IN_SUBPROCESS" not in os.environ:
141-
logger.warning(
142-
"The --python option is ignored if placed after "
143-
"the pip subcommand name"
141+
logger.critical(
142+
"The --python option must be placed before the pip subcommand name"
144143
)
144+
sys.exit(ERROR)
145145

146146
# TODO: Try to get these passing down from the command?
147147
# without resorting to os.environ to hold these.

0 commit comments

Comments
 (0)