2727 strip_py_suffix , count , format_duration ,
2828 printlist , get_temp_dir , get_work_dir , exit_timeout ,
2929 display_header , cleanup_temp_dir , print_warning ,
30- is_cross_compiled , get_host_runner ,
30+ is_cross_compiled , get_host_runner , display_title ,
3131 EXIT_TIMEOUT )
3232
3333
@@ -126,6 +126,7 @@ def __init__(self, ns: Namespace, _add_python_opts: bool = False):
126126 self .coverage : bool = ns .trace
127127 self .coverage_dir : StrPath | None = ns .coverdir
128128 self ._tmp_dir : StrPath | None = ns .tempdir
129+ self .pythoninfo : bool = ns .pythoninfo
129130
130131 # Randomize
131132 self .randomize : bool = ns .randomize
@@ -300,9 +301,7 @@ def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool:
300301 title = f"Bisect { test } "
301302 if progress :
302303 title = f"{ title } ({ progress } )"
303- print (title )
304- print ("#" * len (title ))
305- print ()
304+ display_title (title )
306305
307306 cmd = runtests .create_python_cmd ()
308307 cmd .extend ([
@@ -323,9 +322,7 @@ def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool:
323322 exitcode = proc .returncode
324323
325324 title = f"{ title } : exit code { exitcode } "
326- print (title )
327- print ("#" * len (title ))
328- print (flush = True )
325+ display_title (title )
329326
330327 if exitcode :
331328 print (f"Bisect failed with exit code { exitcode } " )
@@ -740,6 +737,15 @@ def tmp_dir(self) -> StrPath:
740737 )
741738 return self ._tmp_dir
742739
740+ def run_pythoninfo (self ):
741+ from test import pythoninfo
742+ try :
743+ pythoninfo .main ()
744+ except SystemExit :
745+ # Ignore non-zero exit code on purpose
746+ pass
747+ print ()
748+
743749 def main (self , tests : TestList | None = None ) -> NoReturn :
744750 if self .want_add_python_opts :
745751 self ._add_python_opts ()
@@ -753,6 +759,9 @@ def main(self, tests: TestList | None = None) -> NoReturn:
753759 if self .want_wait :
754760 input ("Press any key to continue..." )
755761
762+ if self .pythoninfo :
763+ self .run_pythoninfo ()
764+
756765 setup_test_dir (self .test_dir )
757766 selected , tests = self .find_tests (tests )
758767
0 commit comments