diff --git a/src/virtualenv/discovery/builtin.py b/src/virtualenv/discovery/builtin.py index a4c621715..0b0d26b5d 100644 --- a/src/virtualenv/discovery/builtin.py +++ b/src/virtualenv/discovery/builtin.py @@ -3,7 +3,6 @@ import logging import os import sys -from collections import deque from contextlib import suppress from pathlib import Path from typing import TYPE_CHECKING @@ -23,7 +22,7 @@ class Builtin(Discover): - python_spec: Sequence[str] | deque[str] + python_spec: Sequence[str] app_data: AppData try_first_with: Sequence[str] @@ -31,8 +30,7 @@ def __init__(self, options) -> None: super().__init__(options) self.python_spec = options.python or [sys.executable] if self._env.get("VIRTUALENV_PYTHON"): - self.python_spec = deque(self.python_spec) - self.python_spec.rotate(-1) + self.python_spec = self.python_spec[1:] + self.python_spec[:1] # Rotate the list self.app_data = options.app_data self.try_first_with = options.try_first_with