File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,10 @@ def get_preparation_data(name):
170170 if util ._logger is not None :
171171 d ['log_level' ] = util ._logger .getEffectiveLevel ()
172172
173- sys_path = sys .path .copy ()
173+ sys_path = []
174+ for path in sys .path :
175+ if sys .base_prefix not in os .path .abspath (path ):
176+ sys_path .append (path ) # For cross-interpreter support
174177 try :
175178 i = sys_path .index ('' )
176179 except ValueError :
@@ -226,10 +229,14 @@ def prepare(data):
226229 util .get_logger ().setLevel (data ['log_level' ])
227230
228231 if 'sys_path' in data :
229- sys .path = data ['sys_path' ]
232+ sys_path = data ['sys_path' ].copy ()
233+ for path in data ['sys_path' ]:
234+ if path in sys .path :
235+ sys_path .remove (path )
236+ sys .path .extend (sys_path )
230237
231238 if 'sys_argv' in data :
232- sys .argv = data ['sys_argv' ]
239+ sys .argv = data ['sys_argv' ] # For cross-interpreter support
233240
234241 if 'dir' in data :
235242 os .chdir (data ['dir' ])
You can’t perform that action at this time.
0 commit comments