Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Lib/test/test_gdb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@

GDB_PROGRAM = shutil.which('gdb') or 'gdb'

# First, try to use the build directory to support out-of-tree build
for key in ('abs_builddir', 'abs_srcdir', 'srcdir'):
SRC_DIR = sysconfig.get_config_var(key)
if SRC_DIR:
break
else:
raise Exception("unable to get the Python source directory")

# Location of custom hooks file in a repository checkout.
CHECKOUT_HOOK_PATH = os.path.join(os.path.dirname(sys.executable),
'python-gdb.py')
CHECKOUT_HOOK_PATH = os.path.join(SRC_DIR, 'python-gdb.py')

SAMPLE_SCRIPT = os.path.join(os.path.dirname(__file__), 'gdb_sample.py')
BREAKPOINT_FN = 'builtin_id'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix test_gdb when Python is built out-of-tree and Python is run from a
virtual environment. Previously, test_gdb was just skipped. Patch by Victor
Stinner.
Loading