ianb  committed ebdab23

[svn r21831] Allow pip -E to change Python versions

  • Participants
  • Parent commits fa03e34

Comments (0)

Files changed (2)

File docs/news.txt

 * Fix a problem with ``pip freeze`` not including ``-e svn+`` when an
   svn structure is peculiar.
+* Allow ``pip -E`` to work with a virtualenv that uses a different
+  version of Python than the parent environment.
     if not os.path.exists(python):
         raise BadCommand('Cannot find virtual environment interpreter at %s' % python)
     base = os.path.dirname(os.path.dirname(python))
-    os.execv(python, [python, __file__] + args + [base, '___VENV_RESTART___'])
+    file = __file__
+    if file.endswith('.pyc'):
+        file = file[:-1]
+    os.execv(python, [python, file] + args + [base, '___VENV_RESTART___'])
 class PackageFinder(object):
     """This finds packages.