binutils-gdb/gdb/testsuite/gdb.python/source2.py
Tom Tromey a8e1e2aaf8 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 <lancelot.six@amd.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-03-18 07:20:14 -06:00

22 lines
833 B
Python

# This testcase is part of GDB, the GNU debugger.
# Copyright 2008-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure __file__ is defined.
assert type(__file__) == str
print("y%ss" % "e")