Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clonevirtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ def _dirmatch(path, matchwith):
def _virtualenv_sys(venv_path):
"obtain version and path info from a virtualenv."
executable = os.path.join(venv_path, env_bin_dir, 'python')
env = {}
if sys.platform == 'win32':
executable = os.path.join(venv_path, env_bin_dir, 'python.EXE')
env = { "PATH": os.environ["PATH"] }
# Must use "executable" as the first argument rather than as the
# keyword argument "executable" to get correct value from sys.path
p = subprocess.Popen([executable,
'-c', 'import sys;'
'print ("%d.%d" % (sys.version_info.major, sys.version_info.minor));'
'print ("\\n".join(sys.path));'],
env={},
env=env,
stdout=subprocess.PIPE)
stdout, err = p.communicate()
assert not p.returncode and stdout
Expand Down