diff options
author | Tom de Vries <tdevries@suse.de> | 2025-04-28 18:03:09 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-04-28 18:03:09 +0200 |
commit | 1c32c7150dc955b62e810367d23535643dcb36d5 (patch) | |
tree | 567830eac700e3fbde5ea86900bfe5620c01b726 /gdb/testsuite/gdb.python/py-inferior-leak.py | |
parent | f7745f8ceff9772feb60a96791a366b969811300 (diff) | |
download | binutils-1c32c7150dc955b62e810367d23535643dcb36d5.zip binutils-1c32c7150dc955b62e810367d23535643dcb36d5.tar.gz binutils-1c32c7150dc955b62e810367d23535643dcb36d5.tar.bz2 |
[gdb/testsuite] Avoid generating gdb_leak_detector.cpython-<n>.pyc
After running test-case gdb.python/py-color-leak.exp in a container where I
don't have PYTHONDONTWRITEBYTECODE set, I get:
...
$ ls src/gdb/testsuite/gdb.python/__pycache__/
gdb_leak_detector.cpython-313.pyc
...
Fix this by setting sys.dont_write_bytecode to True in the python scripts
importing the module.
Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-inferior-leak.py')
-rw-r--r-- | gdb/testsuite/gdb.python/py-inferior-leak.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-inferior-leak.py b/gdb/testsuite/gdb.python/py-inferior-leak.py index f764688..bf61668 100644 --- a/gdb/testsuite/gdb.python/py-inferior-leak.py +++ b/gdb/testsuite/gdb.python/py-inferior-leak.py @@ -13,6 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import sys + +# Avoid generating +# src/gdb/testsuite/gdb.python/__pycache__/gdb_leak_detector.cpython-<n>.pyc. +sys.dont_write_bytecode = True + import re import gdb_leak_detector |