Skip to content

Sessions using Python2.7 cannot reuse virtual envs (-r) as Python 2.7 doesn't have attr sys.base_prefix #449

@crwilcox

Description

@crwilcox

Describe the bug
A recent change (2021.6.6) caused reuse of virtual environments targeting older python versions (2.7, likely pre 3.3 as well?) from executing

How to reproduce

❯ nox -r -s system-2.7
nox > Running session system-2.7
nox > Command python2.7 -c import sys; print(getattr(sys, 'real_prefix', sys.base_prefix)) failed with exit code 1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'base_prefix'
nox > Session system-2.7 failed.

NOTE: the session will work if -r is not specified.

Expected behavior
I would expect it to reuse the existing virtual environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions