From a8e1e2aaf8783092b74330e2d4c727f814533cc9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 8 Mar 2024 11:15:01 -0700 Subject: Set __file__ when source'ing a Python script This patch arranges to set __file__ when source'ing a Python script. This fixes a problem that was introduced by the "source" rewrite, and then pointed out by Lancelot Six. Reviewed-by: Lancelot Six Approved-By: Andrew Burgess --- gdb/testsuite/gdb.python/source2.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/testsuite/gdb.python/source2.py') diff --git a/gdb/testsuite/gdb.python/source2.py b/gdb/testsuite/gdb.python/source2.py index 60d59d9..79dc1c2 100644 --- a/gdb/testsuite/gdb.python/source2.py +++ b/gdb/testsuite/gdb.python/source2.py @@ -15,4 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Make sure __file__ is defined. +assert type(__file__) == str + print("y%ss" % "e") -- cgit v1.1