| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 036bbb1 commit 3f398a7
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -616,6 +616,7 @@ def get_config_vars(*args): | |||
| 616 | 616 | ||
| 617 | 617 | if os.name == 'nt': | |
| 618 | 618 | _init_non_posix(_CONFIG_VARS) | |
| 619 | + _CONFIG_VARS['VPATH'] = sys._vpath | ||
| 619 | 620 | if os.name == 'posix': | |
| 620 | 621 | _init_posix(_CONFIG_VARS) | |
| 621 | 622 | # For backward compatibility, see issue19555 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1300,11 +1300,16 @@ def test_init_pybuilddir(self): | |||
| 1300 | 1300 | def test_init_pybuilddir_win32(self): | |
| 1301 | 1301 | # Test path configuration with pybuilddir.txt configuration file | |
| 1302 | 1302 | ||
| 1303 | - with self.tmpdir_with_python(r'PCbuild\arch') as tmpdir: | ||
| 1303 | + vpath = sysconfig.get_config_var("VPATH") | ||
| 1304 | + subdir = r'PCbuild\arch' | ||
| 1305 | + if os.path.normpath(vpath).count(os.sep) == 2: | ||
| 1306 | + subdir = os.path.join(subdir, 'instrumented') | ||
| 1307 | + | ||
| 1308 | + with self.tmpdir_with_python(subdir) as tmpdir: | ||
| 1304 | 1309 | # The prefix is dirname(executable) + VPATH | |
| 1305 | - prefix = os.path.normpath(os.path.join(tmpdir, r'..\..')) | ||
| 1310 | + prefix = os.path.normpath(os.path.join(tmpdir, vpath)) | ||
| 1306 | 1311 | # The stdlib dir is dirname(executable) + VPATH + 'Lib' | |
| 1307 | - stdlibdir = os.path.normpath(os.path.join(tmpdir, r'..\..\Lib')) | ||
| 1312 | + stdlibdir = os.path.normpath(os.path.join(tmpdir, vpath, 'Lib')) | ||
| 1308 | 1313 | ||
| 1309 | 1314 | filename = os.path.join(tmpdir, 'pybuilddir.txt') | |
| 1310 | 1315 | with open(filename, "w", encoding="utf8") as fp: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ | |||
| 187 | 187 | ||
| 188 | 188 | elif os_name == 'nt': | |
| 189 | 189 | BUILDDIR_TXT = 'pybuilddir.txt' | |
| 190 | - BUILD_LANDMARK = r'..\..\Modules\Setup.local' | ||
| 190 | + BUILD_LANDMARK = f'{VPATH}\\Modules\\Setup.local' | ||
| 191 | 191 | DEFAULT_PROGRAM_NAME = f'python' | |
| 192 | 192 | STDLIB_SUBDIR = 'Lib' | |
| 193 | 193 | STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}\\os.py', f'{STDLIB_SUBDIR}\\os.pyc'] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -226,7 +226,9 @@ | |||
| 226 | 226 | <ClCompile Include="..\Python\structmember.c" /> | |
| 227 | 227 | <ClCompile Include="..\Python\suggestions.c" /> | |
| 228 | 228 | <ClCompile Include="..\Python\symtable.c" /> | |
| 229 | - <ClCompile Include="..\Python\sysmodule.c" /> | ||
| 229 | + <ClCompile Include="..\Python\sysmodule.c"> | ||
| 230 | + <PreprocessorDefinitions>VPATH="$(PyVPath)";%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| 231 | + </ClCompile> | ||
| 230 | 232 | <ClCompile Include="..\Python\thread.c" /> | |
| 231 | 233 | <ClCompile Include="..\Python\traceback.c" /> | |
| 232 | 234 | </ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,6 +53,10 @@ | |||
| 53 | 53 | <BuildPath Condition="!HasTrailingSlash($(BuildPath))">$(BuildPath)\</BuildPath> | |
| 54 | 54 | <BuildPath Condition="$(Configuration) == 'PGInstrument'">$(BuildPath)instrumented\</BuildPath> | |
| 55 | 55 | ||
| 56 | + <!-- VPATH definition (escaped) --> | ||
| 57 | + <PyVPath Condition="$(Configuration) != 'PGInstrument'">..\\..</PyVPath> | ||
| 58 | + <PyVPath Condition="$(Configuration) == 'PGInstrument'">..\\..\\..</PyVPath> | ||
| 59 | + | ||
| 56 | 60 | <!-- Directories of external projects. tcltk is handled in tcltk.props --> | |
| 57 | 61 | <ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir> | |
| 58 | 62 | <ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,7 +115,7 @@ | |||
| 115 | 115 | PREFIX=NULL; | |
| 116 | 116 | EXEC_PREFIX=NULL; | |
| 117 | 117 | VERSION=NULL; | |
| 118 | - VPATH="..\\.."; | ||
| 118 | + VPATH="$(PyVPath)"; | ||
| 119 | 119 | PYDEBUGEXT="$(PyDebugExt)"; | |
| 120 | 120 | PLATLIBDIR="DLLs"; | |
| 121 | 121 | %(PreprocessorDefinitions) | |
@@ -519,7 +519,9 @@ | |||
| 519 | 519 | <ClCompile Include="..\Python\suggestions.c" /> | |
| 520 | 520 | <ClCompile Include="..\Python\structmember.c" /> | |
| 521 | 521 | <ClCompile Include="..\Python\symtable.c" /> | |
| 522 | - <ClCompile Include="..\Python\sysmodule.c" /> | ||
| 522 | + <ClCompile Include="..\Python\sysmodule.c"> | ||
| 523 | + <PreprocessorDefinitions>VPATH="$(PyVPath)";%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| 524 | + </ClCompile> | ||
| 523 | 525 | <ClCompile Include="..\Python\thread.c" /> | |
| 524 | 526 | <ClCompile Include="..\Python\traceback.c" /> | |
| 525 | 527 | </ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2823,6 +2823,8 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) | |||
| 2823 | 2823 | goto type_init_failed; | |
| 2824 | 2824 | } | |
| 2825 | 2825 | } | |
| 2826 | + | ||
| 2827 | + SET_SYS_FROM_STRING("_vpath", VPATH); | ||
| 2826 | 2828 | #endif | |
| 2827 | 2829 | ||
| 2828 | 2830 | /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments