2626 strip_py_suffix , count , format_duration ,
2727 printlist , get_temp_dir , get_work_dir , exit_timeout ,
2828 display_header , cleanup_temp_dir , print_warning ,
29- is_cross_compiled , get_host_runner ,
29+ is_cross_compiled , get_host_runner , display_title ,
3030 EXIT_TIMEOUT )
3131
3232
@@ -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
@@ -322,9 +323,7 @@ def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool:
322323 title = f"Bisect { test } "
323324 if progress :
324325 title = f"{ title } ({ progress } )"
325- print (title )
326- print ("#" * len (title ))
327- print ()
326+ display_title (title )
328327
329328 cmd = runtests .create_python_cmd ()
330329 cmd .extend ([
@@ -345,9 +344,7 @@ def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool:
345344 exitcode = proc .returncode
346345
347346 title = f"{ title } : exit code { exitcode } "
348- print (title )
349- print ("#" * len (title ))
350- print (flush = True )
347+ display_title (title )
351348
352349 if exitcode :
353350 print (f"Bisect failed with exit code { exitcode } " )
@@ -752,6 +749,15 @@ def tmp_dir(self) -> StrPath:
752749 )
753750 return self ._tmp_dir
754751
752+ def run_pythoninfo (self ):
753+ from test import pythoninfo
754+ try :
755+ pythoninfo .main ()
756+ except SystemExit :
757+ # Ignore non-zero exit code on purpose
758+ pass
759+ print ()
760+
755761 def main (self , tests : TestList | None = None ) -> NoReturn :
756762 if self .want_add_python_opts :
757763 self ._add_python_opts ()
@@ -765,6 +771,9 @@ def main(self, tests: TestList | None = None) -> NoReturn:
765771 if self .want_wait :
766772 input ("Press any key to continue..." )
767773
774+ if self .pythoninfo :
775+ self .run_pythoninfo ()
776+
768777 setup_test_dir (self .test_dir )
769778 selected , tests = self .find_tests (tests )
770779
0 commit comments