Skip to content

Commit 467c2e4

Browse files
committed
Skip foreign frames in tb_next
1 parent fe55db2 commit 467c2e4

File tree

1 file changed

+4
-3
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/traceback

1 file changed

+4
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/traceback/TracebackBuiltins.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
33
* Copyright (c) 2014, Regents of the University of California
44
*
55
* All rights reserved.
@@ -39,6 +39,7 @@
3939
import com.oracle.graal.python.builtins.PythonBuiltins;
4040
import com.oracle.graal.python.builtins.objects.PNone;
4141
import com.oracle.graal.python.builtins.objects.frame.PFrame;
42+
import com.oracle.graal.python.builtins.objects.function.PArguments;
4243
import com.oracle.graal.python.nodes.frame.MaterializeFrameNode;
4344
import com.oracle.graal.python.nodes.function.PythonBuiltinBaseNode;
4445
import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
@@ -108,8 +109,8 @@ public static PTraceback createTracebackChain(PException exception, MaterializeF
108109
// frames may have not been requested
109110
if (frame != null) {
110111
Node location = element.getLocation();
111-
// only include frames of non-builtin functions
112-
if (location != null && !location.getRootNode().isInternal()) {
112+
// only include frames of non-builtin python functions
113+
if (PArguments.isPythonFrame(frame) && location != null && !location.getRootNode().isInternal()) {
113114
// create the PFrame and refresh frame values
114115
PFrame escapedFrame = materializeNode.execute(null, location, false, true, frame);
115116
cur = factory.createTraceback(escapedFrame, exception);

0 commit comments

Comments
 (0)