@@ -681,7 +681,7 @@ def test_denial_of_service_prevented_int_to_str(self):
681681 digits = 78_268
682682 with (
683683 support .adjust_int_max_str_digits (digits ),
684- support .CPUStopwatch () as sw_convert ):
684+ support .Stopwatch () as sw_convert ):
685685 huge_decimal = str (huge_int )
686686 self .assertEqual (len (huge_decimal ), digits )
687687 # Ensuring that we chose a slow enough conversion to measure.
@@ -696,7 +696,7 @@ def test_denial_of_service_prevented_int_to_str(self):
696696 with support .adjust_int_max_str_digits (int (.995 * digits )):
697697 with (
698698 self .assertRaises (ValueError ) as err ,
699- support .CPUStopwatch () as sw_fail_huge ):
699+ support .Stopwatch () as sw_fail_huge ):
700700 str (huge_int )
701701 self .assertIn ('conversion' , str (err .exception ))
702702 self .assertLessEqual (sw_fail_huge .seconds , sw_convert .seconds / 2 )
@@ -706,7 +706,7 @@ def test_denial_of_service_prevented_int_to_str(self):
706706 extra_huge_int = int (f'0x{ "c" * 500_000 } ' , base = 16 ) # 602060 digits.
707707 with (
708708 self .assertRaises (ValueError ) as err ,
709- support .CPUStopwatch () as sw_fail_extra_huge ):
709+ support .Stopwatch () as sw_fail_extra_huge ):
710710 # If not limited, 8 seconds said Zen based cloud VM.
711711 str (extra_huge_int )
712712 self .assertIn ('conversion' , str (err .exception ))
@@ -722,7 +722,7 @@ def test_denial_of_service_prevented_str_to_int(self):
722722 huge = '8' * digits
723723 with (
724724 support .adjust_int_max_str_digits (digits ),
725- support .CPUStopwatch () as sw_convert ):
725+ support .Stopwatch () as sw_convert ):
726726 int (huge )
727727 # Ensuring that we chose a slow enough conversion to measure.
728728 # It takes 0.1 seconds on a Zen based cloud VM in an opt build.
@@ -734,7 +734,7 @@ def test_denial_of_service_prevented_str_to_int(self):
734734 with support .adjust_int_max_str_digits (digits - 1 ):
735735 with (
736736 self .assertRaises (ValueError ) as err ,
737- support .CPUStopwatch () as sw_fail_huge ):
737+ support .Stopwatch () as sw_fail_huge ):
738738 int (huge )
739739 self .assertIn ('conversion' , str (err .exception ))
740740 self .assertLessEqual (sw_fail_huge .seconds , sw_convert .seconds / 2 )
@@ -744,7 +744,7 @@ def test_denial_of_service_prevented_str_to_int(self):
744744 extra_huge = '7' * 1_200_000
745745 with (
746746 self .assertRaises (ValueError ) as err ,
747- support .CPUStopwatch () as sw_fail_extra_huge ):
747+ support .Stopwatch () as sw_fail_extra_huge ):
748748 # If not limited, 8 seconds in the Zen based cloud VM.
749749 int (extra_huge )
750750 self .assertIn ('conversion' , str (err .exception ))
0 commit comments