From 420065374e3a6ded65cba035cbc716e85ea0dde4 Mon Sep 17 00:00:00 2001 From: CF Bolz-Tereick Date: Sun, 10 Nov 2024 14:00:22 +0100 Subject: [PATCH] Skip test if there is no sys.getrefcount, like on pypy --- Lib/test/test_socket.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index f2bc52ba6e8701..dc8a4a44f37e65 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5334,6 +5334,8 @@ def _testMakefileClose(self): self.write_file.write(self.write_msg) self.write_file.flush() + @unittest.skipUnless(hasattr(sys, 'getrefcount'), + 'test needs sys.getrefcount()') def testMakefileCloseSocketDestroy(self): refcount_before = sys.getrefcount(self.cli_conn) self.read_file.close()