Skip to content

Commit

Permalink
Merge pull request #555 from pv/virtualenv-removehack
Browse files Browse the repository at this point in the history
Use a less hacky way to launch virtualenv
  • Loading branch information
pv authored Sep 27, 2017
2 parents a60250d + e88227d commit 3570fd8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions asv/plugins/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from distutils.version import LooseVersion
import sys
import re
import inspect
import os
import subprocess

import six

Expand Down Expand Up @@ -58,11 +56,6 @@ def __init__(self, conf, python, requirements):
raise environment.EnvironmentUnavailable(
"virtualenv package not installed")

# Can't use `virtualenv.__file__` here, because that will refer to a
# .pyc file which can't be used on another version of Python
self._virtualenv_path = os.path.abspath(
inspect.getsourcefile(virtualenv))

@staticmethod
def _find_python(python):
"""Find Python executable for the given Python version"""
Expand Down Expand Up @@ -137,7 +130,7 @@ def _setup(self):
log.info("Creating virtualenv for {0}".format(self.name))
util.check_call([
sys.executable,
self._virtualenv_path,
"-mvirtualenv",
'--no-site-packages',
"-p",
self._executable,
Expand Down

0 comments on commit 3570fd8

Please sign in to comment.