@@ -233,6 +233,8 @@ def search_up(prefix, *landmarks, test=isfile):
233
233
return prefix
234
234
prefix = dirname (prefix )
235
235
236
+ def _normpath (p ):
237
+ return normpath (p ) if p is not None else None
236
238
237
239
# ******************************************************************************
238
240
# READ VARIABLES FROM config
@@ -670,7 +672,7 @@ def search_up(prefix, *landmarks, test=isfile):
670
672
671
673
if py_setpath :
672
674
# If Py_SetPath was called then it overrides any existing search path
673
- config ['module_search_paths' ] = py_setpath .split (DELIM )
675
+ config ['module_search_paths' ] = [ _normpath ( p ) for p in py_setpath .split (DELIM )]
674
676
config ['module_search_paths_set' ] = 1
675
677
676
678
elif not pythonpath_was_set :
@@ -757,7 +759,7 @@ def search_up(prefix, *landmarks, test=isfile):
757
759
if platstdlib_dir :
758
760
pythonpath .append (platstdlib_dir )
759
761
760
- config ['module_search_paths' ] = pythonpath
762
+ config ['module_search_paths' ] = [ _normpath ( p ) for p in pythonpath ]
761
763
config ['module_search_paths_set' ] = 1
762
764
763
765
@@ -792,23 +794,23 @@ def search_up(prefix, *landmarks, test=isfile):
792
794
warn ("unsupported 'import' line in ._pth file" )
793
795
else :
794
796
pythonpath .append (joinpath (pth_dir , line ))
795
- config ['module_search_paths' ] = pythonpath
797
+ config ['module_search_paths' ] = [ _normpath ( p ) for p in pythonpath ]
796
798
config ['module_search_paths_set' ] = 1
797
799
798
800
# ******************************************************************************
799
801
# UPDATE config FROM CALCULATED VALUES
800
802
# ******************************************************************************
801
803
802
- config ['program_name' ] = program_name
803
- config ['home' ] = home
804
- config ['executable' ] = executable
805
- config ['base_executable' ] = base_executable
806
- config ['prefix' ] = prefix
807
- config ['exec_prefix' ] = exec_prefix
808
- config ['base_prefix' ] = base_prefix or prefix
809
- config ['base_exec_prefix' ] = base_exec_prefix or exec_prefix
804
+ config ['program_name' ] = _normpath ( program_name )
805
+ config ['home' ] = _normpath ( home )
806
+ config ['executable' ] = _normpath ( executable )
807
+ config ['base_executable' ] = _normpath ( base_executable )
808
+ config ['prefix' ] = _normpath ( prefix )
809
+ config ['exec_prefix' ] = _normpath ( exec_prefix )
810
+ config ['base_prefix' ] = _normpath ( base_prefix or prefix )
811
+ config ['base_exec_prefix' ] = _normpath ( base_exec_prefix or exec_prefix )
810
812
811
- config ['platlibdir' ] = platlibdir
813
+ config ['platlibdir' ] = _normpath ( platlibdir )
812
814
# test_embed expects empty strings, not None
813
- config ['stdlib_dir' ] = stdlib_dir or ''
814
- config ['platstdlib_dir' ] = platstdlib_dir or ''
815
+ config ['stdlib_dir' ] = _normpath ( stdlib_dir or '' )
816
+ config ['platstdlib_dir' ] = _normpath ( platstdlib_dir or '' )
0 commit comments