Skip to content

Commit cfea35b

Browse files
committed
catch the PermissionError for macOS
Signed-off-by: Keming <kemingy94@gmail.com>
1 parent b1a5082 commit cfea35b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_profiling/test_sampling_profiler/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def test_sample_target_module(self):
635635
)
636636
class TestSampleProfilerErrorHandling(unittest.TestCase):
637637
def test_invalid_pid(self):
638-
with self.assertRaises(SystemExit):
638+
with self.assertRaises((SystemExit, PermissionError)):
639639
collector = PstatsCollector(sample_interval_usec=100, skip_idle=False)
640640
profiling.sampling.sample.sample(-1, collector, duration_sec=1)
641641

0 commit comments

Comments
 (0)