summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-06-17 09:03:39 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-06-17 09:03:39 (GMT)
commita09331287180ee6be085bffd94e0e7a870ae5361 (patch)
treee20f0ee894d22c2cddbfc2718b2d4d6c43600d50 /Lib
parent970fcef84bb633e96353de6bf517e4837c90436e (diff)
downloadcpython-a09331287180ee6be085bffd94e0e7a870ae5361.zip
cpython-a09331287180ee6be085bffd94e0e7a870ae5361.tar.gz
cpython-a09331287180ee6be085bffd94e0e7a870ae5361.tar.bz2
Issue #15043: skip test_gdb if the custom hooks can't be loaded (backport from 3.x)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_gdb.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index fe2c8e6..3c41625 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -32,6 +32,15 @@ gdbpy_version, _ = p.communicate()
if gdbpy_version == '':
raise unittest.SkipTest("gdb not built with embedded python support")
+# Verify that "gdb" can load our custom hooks
+p = subprocess.Popen(["gdb", "--batch", cmd,
+ "--args", sys.executable],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+__, gdbpy_errors = p.communicate()
+if b"auto-loading has been declined" in gdbpy_errors:
+ msg = "gdb security settings prevent use of custom hooks: %s"
+ raise unittest.SkipTest(msg % gdbpy_errors)
+
def python_is_optimized():
cflags = sysconfig.get_config_vars()['PY_CFLAGS']
final_opt = ""