diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index acfa1cd503b86b..fd328a74134bcf 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5261,6 +5261,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()