8000 bpo-36500: Simplify PCbuild/build.bat and prevent path separator chan… · python/cpython@a9d0a6a · GitHub
[go: up one dir, main page]

Skip to content

Commit a9d0a6a

Browse files
authored
bpo-36500: Simplify PCbuild/build.bat and prevent path separator changing in comments (GH-17644)
1 parent 9e36589 commit a9d0a6a

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

PCbuild/build.bat

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,16 @@ echo on
156156
/p:UseTestMarker=%UseTestMarker% %GITProperty%^
157157
%1 %2 %3 %4 %5 %6 %7 %8 %9
158158

159-
if "%Regen%"=="true" call :Regen
160-
@echo off
161-
exit /b %ERRORLEVEL%
162-
163-
:Regen
164-
echo on
165-
call "%dir%find_msbuild.bat" %MSBUILD%
166-
if not ERRORLEVEL 1 %MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^
167-
/p:IncludeExternals=%IncludeExternals%^
168-
/p:Configuration=%conf% /p:Platform=%platf%^
169-
/p:UseTestMarker=%UseTestMarker% %GITProperty%^
170-
%1 %2 %3 %4 %5 %6 %7 %8 %9
159+
@if not ERRORLEVEL 1 @if "%Regen%"=="true" (
160+
%MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^
161+
/p:IncludeExternals=%IncludeExternals%^
162+
/p:Configuration=%conf% /p:Platform=%platf%^
163+
/p:UseTestMarker=%UseTestMarker% %GITProperty%^
164+
%1 %2 %3 %4 %5 %6 %7 %8 %9
165+
)
171166

172167
@echo off
173-
goto :eof
168+
exit /b %ERRORLEVEL%
174169

175170
:Version
176171
rem Display the current build version information

Parser/asdl_c.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,8 @@ def generate_module_def(f, mod):
13311331
def main(srcfile, dump_module=False):
13321332
argv0 = sys.argv[0]
13331333
components = argv0.split(os.sep)
1334-
argv0 = os.sep.join(components[-2:])
1334+
# Always join with '/' so different OS does not keep changing the file
1335+
argv0 = '/'.join(components[-2:])
13351336
auto_gen_msg = common_msg % argv0
13361337
mod = asdl.parse(srcfile)
13371338
if dump_module:

0 commit comments

Comments
 (0)
0