From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:39:26 +0000 (+0100) Subject: [3.12] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120... X-Git-Tag: v3.12.9~140 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23e8fc277593df872498b6e06bda476f824f3d01;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120) (#128124) gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120) (cherry picked from commit cbfe3023e46b544b80ea1a38a8c900c6fb881554) Co-authored-by: Victor Stinner --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index b40ad28f7a7d..8fda0d7f8bac 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -513,7 +513,10 @@ class ThreadedVSOCKSocketStreamTest(unittest.TestCase, ThreadableTest): self.cli.connect((cid, VSOCKPORT)) def testStream(self): - msg = self.conn.recv(1024) + try: + msg = self.conn.recv(1024) + except PermissionError as exc: + self.skipTest(repr(exc)) self.assertEqual(msg, MSG) def _testStream(self):