Files
binutils-gdb/gdb/python
Tom de Vries 922ab963e1 [gdb/python] Handle empty PYTHONDONTWRITEBYTECODE
When using PYTHONDONTWRITEBYTECODE with an empty string we get:
...
$ PYTHONDONTWRITEBYTECODE= gdb -q -batch -ex "show python dont-write-bytecode"
Python's dont-write-bytecode setting is auto (currently on).
...

This is incorrect, it should be off.

The actual setting is correct, that was already fixed in commit 24d2cbc42c
("set/show python dont-write-bytecode fixes"), in function
python_write_bytecode.

Fix this by:
- factoring out new function env_python_dont_write_bytecode out of
  python_write_bytecode, and
- using it in show_python_dont_write_bytecode.

Tested on x86_64-linux, using test-case gdb.python/py-startup-opt.exp and:
- PYTHONDONTWRITEBYTECODE=
- PYTHONDONTWRITEBYTECODE=1
- unset PYTHONDONTWRITEBYTECODE

Approved-By: Tom Tromey <tom@tromey.com>

PR python/32389
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32389
2024-12-03 22:54:23 +01:00
..
2024-11-01 11:06:47 -06:00
2024-05-17 09:39:41 -06:00
2024-11-01 11:06:47 -06:00
2024-11-01 11:06:47 -06:00
2024-09-30 13:23:35 -06:00