]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Avoid generating gdb_leak_detector.cpython-<n>.pyc
authorTom de Vries <tdevries@suse.de>
Mon, 28 Apr 2025 16:03:09 +0000 (18:03 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 28 Apr 2025 16:03:09 +0000 (18:03 +0200)
commit1c32c7150dc955b62e810367d23535643dcb36d5
tree567830eac700e3fbde5ea86900bfe5620c01b726
parentf7745f8ceff9772feb60a96791a366b969811300
[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.
gdb/testsuite/gdb.python/py-color-leak.py
gdb/testsuite/gdb.python/py-inferior-leak.py
gdb/testsuite/gdb.python/py-read-memory-leak.py