From 3071ebf7b38341e89be04aa64c257c4643e0648c Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Wed, 30 Oct 2019 09:45:13 -0700 Subject: [LLDB][PythonFile] fix dangerous borrow semantics on python2 Summary: It is inherently unsafe to allow a python program to manipulate borrowed memory from a python object's destructor. It would be nice to flush a borrowed file when python is finished with it, but it's not safe to do on python 2. Python 3 does not suffer from this issue. Reviewers: labath, mgorny Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69532 --- .../Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/python_api/file_handle') diff --git a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py index f7f1ad08500..5d025a46dce 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py @@ -851,10 +851,6 @@ class FileHandleTestCase(lldbtest.TestBase): yield sbf sbf.Write(str(i).encode('ascii') + b"\n") files = list(i(sbf)) - # delete them in reverse order, again because each is a borrow - # of the previous. - while files: - files.pop() with open(self.out_filename, 'r') as f: self.assertEqual(list(range(10)), list(map(int, f.read().strip().split()))) -- cgit v1.2.3