Skip to content

Commit 56ef466

Browse files
authored
Merge pull request #2826 from DK96-OS/cli-precedence-2285
Simplify Solution to --python command-line flag precedence
1 parent caf03a2 commit 56ef466

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/virtualenv/discovery/builtin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import os
55
import sys
6-
from collections import deque
76
from contextlib import suppress
87
from pathlib import Path
98
from typing import TYPE_CHECKING
@@ -23,16 +22,15 @@
2322

2423

2524
class Builtin(Discover):
26-
python_spec: Sequence[str] | deque[str]
25+
python_spec: Sequence[str]
2726
app_data: AppData
2827
try_first_with: Sequence[str]
2928

3029
def __init__(self, options) -> None:
3130
super().__init__(options)
3231
self.python_spec = options.python or [sys.executable]
3332
if self._env.get("VIRTUALENV_PYTHON"):
34-
self.python_spec = deque(self.python_spec)
35-
self.python_spec.rotate(-1)
33+
self.python_spec = self.python_spec[1:] + self.python_spec[:1] # Rotate the list
3634
self.app_data = options.app_data
3735
self.try_first_with = options.try_first_with
3836

0 commit comments

Comments
 (0)