@@ -590,7 +590,7 @@ def test_denial_of_service_prevented_int_to_str(self):
590590 digits = 78_268
591591 with (
592592 support .adjust_int_max_str_digits (digits ),
593- support .CPUStopwatch () as sw_convert ):
593+ support .Stopwatch () as sw_convert ):
594594 huge_decimal = str (huge_int )
595595 self .assertEqual (len (huge_decimal ), digits )
596596 # Ensuring that we chose a slow enough conversion to measure.
@@ -605,7 +605,7 @@ def test_denial_of_service_prevented_int_to_str(self):
605605 with support .adjust_int_max_str_digits (int (.995 * digits )):
606606 with (
607607 self .assertRaises (ValueError ) as err ,
608- support .CPUStopwatch () as sw_fail_huge ):
608+ support .Stopwatch () as sw_fail_huge ):
609609 str (huge_int )
610610 self .assertIn ('conversion' , str (err .exception ))
611611 self .assertLessEqual (sw_fail_huge .seconds , sw_convert .seconds / 2 )
@@ -615,7 +615,7 @@ def test_denial_of_service_prevented_int_to_str(self):
615615 extra_huge_int = int (f'0x{ "c" * 500_000 } ' , base = 16 ) # 602060 digits.
616616 with (
617617 self .assertRaises (ValueError ) as err ,
618- support .CPUStopwatch () as sw_fail_extra_huge ):
618+ support .Stopwatch () as sw_fail_extra_huge ):
619619 # If not limited, 8 seconds said Zen based cloud VM.
620620 str (extra_huge_int )
621621 self .assertIn ('conversion' , str (err .exception ))
@@ -630,7 +630,7 @@ def test_denial_of_service_prevented_str_to_int(self):
630630 huge = '8' * digits
631631 with (
632632 support .adjust_int_max_str_digits (digits ),
633- support .CPUStopwatch () as sw_convert ):
633+ support .Stopwatch () as sw_convert ):
634634 int (huge )
635635 # Ensuring that we chose a slow enough conversion to measure.
636636 # It takes 0.1 seconds on a Zen based cloud VM in an opt build.
@@ -642,7 +642,7 @@ def test_denial_of_service_prevented_str_to_int(self):
642642 with support .adjust_int_max_str_digits (digits - 1 ):
643643 with (
644644 self .assertRaises (ValueError ) as err ,
645- support .CPUStopwatch () as sw_fail_huge ):
645+ support .Stopwatch () as sw_fail_huge ):
646646 int (huge )
647647 self .assertIn ('conversion' , str (err .exception ))
648648 self .assertLessEqual (sw_fail_huge .seconds , sw_convert .seconds / 2 )
@@ -652,7 +652,7 @@ def test_denial_of_service_prevented_str_to_int(self):
652652 extra_huge = '7' * 1_200_000
653653 with (
654654 self .assertRaises (ValueError ) as err ,
655- support .CPUStopwatch () as sw_fail_extra_huge ):
655+ support .Stopwatch () as sw_fail_extra_huge ):
656656 # If not limited, 8 seconds in the Zen based cloud VM.
657657 int (extra_huge )
658658 self .assertIn ('conversion' , str (err .exception ))
0 commit comments