[Python-checkins] bpo-36500: Simplify PCbuild/build.bat and prevent path separator changing in comments (GH-17644)

Steve Dower webhook-mailer at python.org
Tue Dec 17 17:14:20 EST 2019


https://github.com/python/cpython/commit/a9d0a6a1b932752873e04714c5dda707729078e4
commit: a9d0a6a1b932752873e04714c5dda707729078e4
branch: master
author: Steve Dower <steve.dower at python.org>
committer: GitHub <noreply at github.com>
date: 2019-12-17T14:14:13-08:00
summary:

bpo-36500: Simplify PCbuild/build.bat and prevent path separator changing in comments (GH-17644)

files:
M PCbuild/build.bat
M Parser/asdl_c.py

diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index 5bc5da9e1c9ea..7c24e0b155578 100644
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -156,21 +156,16 @@ echo on
  /p:UseTestMarker=%UseTestMarker% %GITProperty%^
  %1 %2 %3 %4 %5 %6 %7 %8 %9
 
-if "%Regen%"=="true" call :Regen
- at echo off
-exit /b %ERRORLEVEL%
-
-:Regen
-echo on
-call "%dir%find_msbuild.bat" %MSBUILD%
-if not ERRORLEVEL 1 %MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^
- /p:IncludeExternals=%IncludeExternals%^
- /p:Configuration=%conf% /p:Platform=%platf%^
- /p:UseTestMarker=%UseTestMarker% %GITProperty%^
- %1 %2 %3 %4 %5 %6 %7 %8 %9
+ at if not ERRORLEVEL 1 @if "%Regen%"=="true" (
+    %MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^
+     /p:IncludeExternals=%IncludeExternals%^
+     /p:Configuration=%conf% /p:Platform=%platf%^
+     /p:UseTestMarker=%UseTestMarker% %GITProperty%^
+     %1 %2 %3 %4 %5 %6 %7 %8 %9
+)
 
 @echo off
-goto :eof
+exit /b %ERRORLEVEL%
 
 :Version
 rem Display the current build version information
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 52495e9b451c1..daac0966f564a 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -1331,7 +1331,8 @@ def generate_module_def(f, mod):
 def main(srcfile, dump_module=False):
     argv0 = sys.argv[0]
     components = argv0.split(os.sep)
-    argv0 = os.sep.join(components[-2:])
+    # Always join with '/' so different OS does not keep changing the file
+    argv0 = '/'.join(components[-2:])
     auto_gen_msg = common_msg % argv0
     mod = asdl.parse(srcfile)
     if dump_module:



More information about the Python-checkins mailing list