File tree 2 files changed +4
-6
lines changed
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):
180
180
platforms = []
181
181
platform_positions = WheelDownloader ._marker_at (markers , "sys_platform" )
182
182
deleted = 0
183
- for pos in platform_positions : # can only be ore meaningfully
183
+ for pos in platform_positions : # can only be or meaningfully
184
184
platform = f"{ markers [pos ][1 ].value } { markers [pos ][2 ].value } "
185
185
deleted += WheelDownloader ._del_marker_at (markers , pos - deleted )
186
186
platforms .append (platform )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def __init__(self, session) -> None:
18
18
sys .executable ,
19
19
activate_script = "activate_this.py" ,
20
20
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)" ,
22
22
)
23
23
self .unix_line_ending = not IS_WIN
24
24
@@ -36,6 +36,7 @@ def _get_test_lines(activate_script):
36
36
import os
37
37
import sys
38
38
import platform
39
+ import runpy
39
40
40
41
def print_r(value):
41
42
print(repr(value))
@@ -47,10 +48,7 @@ def print_r(value):
47
48
48
49
file_at = { str (activate_script )!r}
49
50
# 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)
54
52
print_r(os.environ.get("VIRTUAL_ENV"))
55
53
print_r(os.environ.get("VIRTUAL_ENV_PROMPT"))
56
54
print_r(os.environ.get("PATH").split(os.pathsep))
You can’t perform that action at this time.
0 commit comments