File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -844,6 +844,12 @@ def test_gc(self):
844
844
# Some older versions of gdb will fail with
845
845
# "Cannot find new threads: generic error"
846
846
# unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround
847
+ #
848
+ # gdb will also generate many erroneous errors such as:
849
+ # Function "meth_varargs" not defined.
850
+ # This is because we are calling functions from an "external" module
851
+ # (_testcapimodule) rather than compiled-in functions. It seems difficult
852
+ # to suppress these. See also the comment in DebuggerTests.get_stack_trace
847
853
def test_pycfunction (self ):
848
854
'Verify that "py-bt" displays invocations of PyCFunction instances'
849
855
# Various optimizations multiply the code paths by which these are
@@ -866,12 +872,14 @@ def test_pycfunction(self):
866
872
# '_testcapi.MethInstance()',
867
873
):
868
874
with self .subTest (f'{ obj } .{ func_name } ' ):
869
- cmd = ('import _testcapi\n ' # (not always needed)
870
- 'def foo():\n '
871
- f' { obj } .{ func_name } ({ args } )\n '
872
- 'def bar():\n '
873
- ' foo()\n '
874
- 'bar()\n ' )
875
+ cmd = textwrap .dedent (f'''
876
+ import _testcapi # (not always needed)
877
+ def foo():
878
+ { obj } .{ func_name } ({ args } )
879
+ def bar():
880
+ foo()
881
+ bar()
882
+ ''' )
875
883
# Verify with "py-bt":
876
884
gdb_output = self .get_stack_trace (
877
885
cmd ,
You can’t perform that action at this time.
0 commit comments