-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix python 2 activator from python 3 invalid (#1794)
- Loading branch information
1 parent
bb7bb71
commit 56dd662
Showing
6 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix generating a Python 2 environment from Python 3 creates invalid python activator - by :user:`gaborbernat`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from virtualenv.activation import PythonActivator | ||
from virtualenv.config.cli.parser import VirtualEnvOptions | ||
from virtualenv.run import session_via_cli | ||
|
||
|
||
def test_from_py3_to_py2(session_app_data, cross_python, special_name_dir): | ||
options = VirtualEnvOptions() | ||
cli_args = [ | ||
str(special_name_dir), | ||
"-p", | ||
str(cross_python.executable), | ||
"--app-data", | ||
str(session_app_data.path), | ||
"--without-pip", | ||
"--activators", | ||
"", | ||
] | ||
session = session_via_cli(cli_args, options) | ||
activator = PythonActivator(options) | ||
session.creator.bin_dir.mkdir(parents=True) | ||
result = activator.generate(session.creator) | ||
content = result.read_text() | ||
assert "\"'" not in content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters