Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 755f4c1

Browse files
committed
Added -O option (to run python or python_d w/ -O),
1 parent 6ac3c7b commit 755f4c1

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

PCbuild/rt.bat

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,34 @@
22
@rem Plain "rt" runs Release build, arguments passed on to regrtest.
33
@rem "rt -d" runs Debug build similarly, after shifting off -d.
44
@rem Normally the tests are run twice, the first time after deleting
5-
@rem all the .py[co] files from Lib/ and Lib/test. But
5+
@rem all the .py[co] files from Lib/ and Lib/test/. But
66
@rem "rt -q" (for Quick) runs the tests just once, and without
77
@rem bothering to delete .py[co] files.
8+
@rem "rt -O" runs python or python_d with -O (depending on -d).
89
@set _exe=python
910
@set _qmode=no
11+
@set _dashO=
12+
@goto CheckOpts
13+
:Again
14+
@shift
15+
:CheckOpts
16+
@if "%1"=="-O" set _dashO=-O
17+
@if "%1"=="-O" goto Again
1018
@if "%1"=="-q" set _qmode=yes
11-
@if "%1"=="-q" shift
19+
@if "%1"=="-q" goto Again
1220
@if "%1"=="-d" set _exe=python_d
13-
@if "%1"=="-d" shift
14-
@if "%_qmode%"=="yes" goto Qmode
15-
@if "%1"=="-q" set _qmode=yes
16-
@if "%1"=="-q" shift
21+
@if "%1"=="-d" goto Again
1722
@if "%_qmode%"=="yes" goto Qmode
1823
@echo Deleting .pyc/.pyo files ...
1924
@del ..\Lib\*.pyc
2025
@del ..\Lib\*.pyo
2126
@del ..\Lib\test\*.pyc
2227
@del ..\Lib\test\*.pyo
23-
%_exe% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
28+
%_exe% %_dashO% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
2429
@echo About to run again without deleting .pyc/.pyo first:
2530
@pause
2631
:Qmode
27-
%_exe% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
32+
%_exe% %_dashO% ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
2833
@set _exe=
2934
@set _qmode=
35+
@set _dashO=

0 commit comments

Comments
 (0)