File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ def get_dependencies(whl, version):
180180 platforms = []
181181 platform_positions = WheelDownloader ._marker_at (markers , "sys_platform" )
182182 deleted = 0
183- for pos in platform_positions : # can only be ore meaningfully
183+ for pos in platform_positions : # can only be or meaningfully
184184 platform = f"{ markers [pos ][1 ].value } { markers [pos ][2 ].value } "
185185 deleted += WheelDownloader ._del_marker_at (markers , pos - deleted )
186186 platforms .append (platform )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def __init__(self, session) -> None:
1818 sys .executable ,
1919 activate_script = "activate_this.py" ,
2020 extension = "py" ,
21- non_source_fail_message = "You must use exec(open(this_file).read(), {'__file__': this_file} )" ,
21+ non_source_fail_message = "You must use import runpy; runpy.run_path( this_file)" ,
2222 )
2323 self .unix_line_ending = not IS_WIN
2424
@@ -36,6 +36,7 @@ def _get_test_lines(activate_script):
3636 import os
3737 import sys
3838 import platform
39+ import runpy
3940
4041 def print_r(value):
4142 print(repr(value))
@@ -47,10 +48,7 @@ def print_r(value):
4748
4849 file_at = { str (activate_script )!r}
4950 # CPython 2 requires non-ascii path open to be unicode
50- with open(file_at, "r", encoding='utf-8') as file_handler:
51- content = file_handler.read()
52- exec(content, {{"__file__": file_at}})
53-
51+ runpy.run_path(file_at)
5452 print_r(os.environ.get("VIRTUAL_ENV"))
5553 print_r(os.environ.get("VIRTUAL_ENV_PROMPT"))
5654 print_r(os.environ.get("PATH").split(os.pathsep))
You can’t perform that action at this time.
0 commit comments